stdfu

package module
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: LGPL-3.0 Imports: 4 Imported by: 1

README

STDFU Library for using the MD-380 (and other) DMR Radios in DFU mode

This library provides a go API for using the MD-380 (and other DMR radios) in DFU (Device Firmware Update) mode.

Author

Dale Farnsworth

dale@farnsworth.org

IRC: libera.chat channel: #md380, user: dfarnsworth

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDevNotFound = fmt.Errorf("No devices found")
View Source
var ErrMultipleDevs = fmt.Errorf("Multiple devices found")

Functions

This section is empty.

Types

type DfuStatus

type DfuStatus struct {
	Status      Status
	PollTimeout int
	State       State
	IString     int
}

type StDfu

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

func New

func New() (*StDfu, error)

func (*StDfu) Abort

func (stDfu *StDfu) Abort() error

func (*StDfu) Close

func (stDfu *StDfu) Close()

func (*StDfu) ClrStatus

func (stDfu *StDfu) ClrStatus() error

func (*StDfu) Detach

func (stDfu *StDfu) Detach() error

func (*StDfu) Dnload

func (stDfu *StDfu) Dnload(blockNumber int, buffer []byte) error

func (*StDfu) GetState

func (stDfu *StDfu) GetState() (State, error)

func (*StDfu) GetStatus

func (stDfu *StDfu) GetStatus() (DfuStatus, error)

func (*StDfu) GetStringDescriptor

func (stDfu *StDfu) GetStringDescriptor(index int) (string, error)

func (*StDfu) SelectCurrentConfiguration

func (stDfu *StDfu) SelectCurrentConfiguration(configIdx, interfaceIdx, altSetIdx int) error

func (*StDfu) Upload

func (stDfu *StDfu) Upload(blockNumber int, buffer []byte) error

type State

type State int
const (
	AppIdle State = iota
	AppDetach
	DfuIdle
	DfuWriteSync
	DfuWriteBusy
	DfuWriteIdle
	DfuManifestSync
	DfuManifest
	DfuManifestWaitReset
	DfuReadIdle
	DfuError
)

func (State) String

func (s State) String() string

type Status

type Status int
const (
	StatusOk Status = iota
	ErrTarget
	ErrFile
	ErrWrite
	ErrErase
	ErrCheckErased
	ErrProgram
	ErrVerify
	ErrAddress
	ErrNotDone
	ErrFirmware
	ErrVendor
	ErrUsbR
	ErrPOR
	ErrUnknown
	ErrStalledPkt
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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