dfu

package
v0.0.0-...-7cec17d Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DFU_OP_PROTOCOL_VERSION  dfuOperation = 0x00
	DFU_OP_OBJECT_CREATE     dfuOperation = 0x01
	DFU_OP_RECEIPT_NOTIF_SET dfuOperation = 0x02
	DFU_OP_CRC_GET           dfuOperation = 0x03
	DFU_OP_OBJECT_EXECUTE    dfuOperation = 0x04
	DFU_OP_OBJECT_SELECT     dfuOperation = 0x06
	DFU_OP_MTU_GET           dfuOperation = 0x07
	DFU_OP_OBJECT_WRITE      dfuOperation = 0x08
	DFU_OP_PING              dfuOperation = 0x09
	DFU_OP_HARDWARE_VERSION  dfuOperation = 0x0A
	DFU_OP_FIRMWARE_VERSION  dfuOperation = 0x0B
	DFU_OP_ABORT             dfuOperation = 0x0C
	DFU_OP_RESPONSE          dfuOperation = 0x60
	DFU_OP_INVALID           dfuOperation = 0xFF
)
View Source
const (
	DFU_RESULT_INVALID_CODE               dfuResult = 0x00
	DFU_RESULT_SUCCESS                    dfuResult = 0x01
	DFU_RESULT_OPCODE_NOT_SUPPORTED       dfuResult = 0x02
	DFU_RESULT_INVALID_PARAMETER          dfuResult = 0x03
	DFU_RESULT_INSUFFICIENT_RESOURCES     dfuResult = 0x04
	DFU_RESULT_INVALID_OBJECT             dfuResult = 0x05
	DFU_RESULT_UNSUPPORTED_TYPE           dfuResult = 0x07
	DFU_RESULT_DFUOPERATION_NOT_PERMITTED dfuResult = 0x08
	DFU_RESULT_DFUOPERATION_FAILED        dfuResult = 0x0A
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumResponse

type ChecksumResponse struct {
	Offset uint32
	Crc32  uint32
}

type Dfu

type Dfu struct {
	// contains filtered or unexported fields
}

func (*Dfu) EnterBootloader

func (dfu *Dfu) EnterBootloader() error

func (*Dfu) SetDeviceAddress

func (dfu *Dfu) SetDeviceAddress(address string)

func (*Dfu) SetDeviceName

func (dfu *Dfu) SetDeviceName(name string)

func (*Dfu) Update

func (dfu *Dfu) Update(filename string, progress DfuProgress) error

type DfuProgress

type DfuProgress func(value int64, maxValue int64, info string)

type FirmwareUpdater

type FirmwareUpdater interface {
	SetDeviceAddress(address string)
	SetDeviceName(name string)
	Update(filename string, progress DfuProgress) error
	EnterBootloader() error
}

func NewDfu

func NewDfu(bleClient ble.Client, timeout time.Duration) FirmwareUpdater

type SelectResponse

type SelectResponse struct {
	MaxSize uint32
	Offset  uint32
	Crc32   uint32
}

Jump to

Keyboard shortcuts

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