Add doc comments to api package

This commit is contained in:
2021-10-22 21:01:18 -07:00
parent 80a5867d6b
commit d7057e3f9c
4 changed files with 37 additions and 0 deletions
+4
View File
@@ -6,15 +6,19 @@ import (
"go.arsenm.dev/itd/internal/types"
)
// DFUProgress stores the progress of a DFU upfate
type DFUProgress types.DFUProgress
// UpgradeType indicates the type of upgrade to be performed
type UpgradeType uint8
// Type of DFU upgrade
const (
UpgradeTypeArchive UpgradeType = iota
UpgradeTypeFiles
)
// FirmwareUpgrade initiates a DFU update and returns the progress channel
func (c *Client) FirmwareUpgrade(upgType UpgradeType, files ...string) (<-chan DFUProgress, error) {
err := json.NewEncoder(c.conn).Encode(types.Request{
Type: types.ReqTypeFwUpgrade,