Documentation
¶
Index ¶
- Variables
- func ParseError(data []byte) error
- type BLClient
- func (blc *BLClient) CheckImage() error
- func (blc *BLClient) Close() error
- func (blc *BLClient) Command(data []byte, length int) ([]byte, error)
- func (blc *BLClient) GetBootInfo() ([]byte, error)
- func (blc *BLClient) Handshake() error
- func (blc *BLClient) LoadBootHeader(r io.Reader) (n int, err error)
- func (blc *BLClient) LoadSegmentData(r io.Reader) (n int, err error)
- func (blc *BLClient) LoadSegmentHeader(r io.Reader) (n int, err error)
- func (blc *BLClient) Read(length int) ([]byte, error)
- func (blc *BLClient) ReadJedecId() ([]byte, error)
- func (blc *BLClient) ResetDevice() error
- func (blc *BLClient) RunImage() error
- func (blc *BLClient) TryCommand(data []byte, length int) (b []byte, err error)
- func (blc *BLClient) Write(data []byte) (err error)
- type BLClientOption
- type BLClientOptionFunc
- type BlfbResponseError
- type ErrCodeCmd
- type ErrCodeFlash
- type ErrCodeIF
- type ErrCodeImage
- type ErrCodeMisc
- type ErrType
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ParseError ¶
Types ¶
type BLClient ¶
type BLClient struct {
// contains filtered or unexported fields
}
func (*BLClient) CheckImage ¶
func (*BLClient) GetBootInfo ¶
func (*BLClient) LoadBootHeader ¶
func (*BLClient) LoadSegmentData ¶
func (*BLClient) LoadSegmentHeader ¶
func (*BLClient) ReadJedecId ¶
func (*BLClient) ResetDevice ¶
func (*BLClient) TryCommand ¶
type BLClientOption ¶
type BLClientOption interface {
Apply(blc *BLClient)
}
func WithBaudRate ¶
func WithBaudRate(baudrate int) BLClientOption
func WithLogger ¶
func WithLogger(l *zap.SugaredLogger) BLClientOption
func WithReadBufferSize ¶
func WithReadBufferSize(n int) BLClientOption
func WithReadTimeout ¶
func WithReadTimeout(n int) BLClientOption
func WithWriteTimeout ¶
func WithWriteTimeout(n int) BLClientOption
type BLClientOptionFunc ¶
type BLClientOptionFunc func(blc *BLClient)
func (BLClientOptionFunc) Apply ¶
func (fn BLClientOptionFunc) Apply(blc *BLClient)
type ErrCodeCmd ¶
type ErrCodeCmd uint8
const ( ERR_CMD_ID_ERROR ErrCodeCmd = iota + 1 ERR_CMD_LEN_ERROR ERR_CMD_CRC_ERROR ERR_CMD_SEQ_ERROR )
cmd
type ErrCodeFlash ¶
type ErrCodeFlash uint8
const ( ERR_FLASH_INIT_ERROR ErrCodeFlash = iota + 1 ERR_FLASH_ERASE_PARA_ERROR ERR_FLASH_ERASE_ERROR ERR_FLASH_WRITE_PARA_ERROR ERR_FLASH_WRITE_ADDR_ERROR ERR_FLASH_WRITE_ERROR ERR_FLASH_BOOT_PARA_ERROR ERR_FLASH_SET_PARA_ERROR ERR_FLASH_READ_STATUS_REG_ERROR ERR_FLASH_WRITE_STATUS_REG_ERROR )
flash
type ErrCodeImage ¶
type ErrCodeImage uint8
const ( ERR_IMG_BOOTHEADER_LEN_ERROR ErrCodeImage = iota + 1 ERR_IMG_BOOTHEADER_NOT_LOAD_ERROR ERR_IMG_BOOTHEADER_MAGIC_ERROR ERR_IMG_BOOTHEADER_CRC_ERROR ERR_IMG_BOOTHEADER_ENCRYPT_NOTFIT ERR_IMG_BOOTHEADER_SIGN_NOTFIT ERR_IMG_SEGMENT_CNT_ERROR ERR_IMG_AES_IV_LEN_ERROR ERR_IMG_AES_IV_CRC_ERROR ERR_IMG_PK_LEN_ERROR ERR_IMG_PK_CRC_ERROR ERR_IMG_PK_HASH_ERROR ERR_IMG_SIGNATURE_LEN_ERROR ERR_IMG_SIGNATURE_CRC_ERROR ERR_IMG_SECTIONHEADER_LEN_ERROR ERR_IMG_SECTIONHEADER_CRC_ERROR ERR_IMG_SECTIONHEADER_DST_ERROR ERR_IMG_SECTIONDATA_LEN_ERROR ERR_IMG_SECTIONDATA_DEC_ERROR ERR_IMG_SECTIONDATA_TLEN_ERROR ERR_IMG_SECTIONDATA_CRC_ERROR ERR_IMG_HALFBAKED_ERROR ERR_IMG_HASH_ERROR ERR_IMG_SIGN_PARSE_ERROR ERR_IMG_SIGN_ERROR ERR_IMG_DEC_ERROR ERR_IMG_ALL_INVALID_ERROR )
image
type ErrCodeMisc ¶
type ErrCodeMisc uint8
const ( ERR_PLL_ERROR ErrCodeMisc = iota + 252 ERR_INVASION_ERROR ERR_POLLING ERR_FAIL )
MISC
Click to show internal directories.
Click to hide internal directories.