wally

package
v0.0.0-...-a6648f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DFUFlash

func DFUFlash(s *State)

func GetAppVersion

func GetAppVersion() string

GetAppVersion returns the current version number.

func TeensyFlash

func TeensyFlash(s *State)

TeensyFlash: Flashes Teensy boards. It opens the firmware file at the provided path, checks it's integrity, wait for the keyboard to be in Flash mode, flashes it and reboots the board.

Types

type Device

type Device struct {
	Model int `json:"model"` // 0 - planck // 1 - ergodox // 2 - moonlander
	Bus   int `json:"bus"`
	Port  int `json:"port"`
}

func ProbeDevices

func ProbeDevices(s *State) []Device

type FlashProgress

type FlashProgress struct {
	Total int `json:"total"` // total of firmware bytes to send
	Sent  int `json:"sent"`  // total of bytes sent
}

FlashProgress represents the current flashing state, it gets updated by the flashing methods.

type State

type State struct {
	AppVersion    string        `json:"appVersion"`
	Device        Device        `json:"device"`        // The user selected usb device
	Devices       []Device      `json:"devices"`       // The list of usb devices connected
	Step          Step          `json:"step"`          // The current flashing process step
	FirmwarePath  string        `json:"firmwarePath"`  // The firmware absolute Path selected by the user
	FlashProgress FlashProgress `json:"flashProgress"` // The Flashing state progress
	Logs          []log         `json:"logs"`          // Log object
	// contains filtered or unexported fields
}

State represents the global state of the application

func NewState

func NewState(step Step, filePath string) *State

func (*State) CompleteFlash

func (s *State) CompleteFlash()

func (*State) FlashFirmware

func (s *State) FlashFirmware()

func (*State) Log

func (s *State) Log(level string, message string)

func (*State) ProbeDevices

func (s *State) ProbeDevices()

func (*State) ResetState

func (s *State) ResetState()

func (*State) SelectDevice

func (s *State) SelectDevice(model int, bus int, port int)

func (*State) SelectFirmware

func (s *State) SelectFirmware()

func (*State) SelectFirmwareWithData

func (s *State) SelectFirmwareWithData(data string)

func (*State) Shutdown

func (s *State) Shutdown()

func (*State) WailsInit

func (s *State) WailsInit(runtime *wails.Runtime) error

type Step

type Step int8
const (
	Probing        Step = iota // probing keyboard
	SelectKeyboard             // select keyboard
	FirmwareFile               // select firmware file
	Waiting                    // waiting for keyboard reset
	Flashing                   // flashing
	Complete                   // complete
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL