Documentation ¶
Overview ¶
Package bootloader contains the API to the physical device.
Index ¶
- func HashFirmware(firmwareVersion uint32, unsignedFirmware []byte) []byte
- func ParseSignedFirmware(firmware []byte) (common.Product, []byte, []byte, error)
- type Communication
- type Device
- func (device *Device) Close()
- func (device *Device) Erased() (bool, error)
- func (device *Device) GetHashes(displayFirmwareHash, displaySigningKeydataHash bool) ([]byte, []byte, error)
- func (device *Device) Product() common.Product
- func (device *Device) Reboot() error
- func (device *Device) ScreenRotate() error
- func (device *Device) SetShowFirmwareHashEnabled(enabled bool) error
- func (device *Device) ShowFirmwareHashEnabled() (bool, error)
- func (device *Device) SignedFirmwareVersion(firmware []byte) (uint32, error)
- func (device *Device) Status() *Status
- func (device *Device) UpgradeFirmware(firmware []byte) error
- func (device *Device) Versions() (uint32, uint32, error)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashFirmware ¶
HashFirmware returns the hash of `<firmware version><firmware>`, as computed by the bootloader to check the firmware signature.
Types ¶
type Communication ¶
Communication contains functions needed to communicate with the device.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device provides the API to communicate with the BitBox02 bootloader.
func NewDevice ¶
func NewDevice( version *semver.SemVer, product common.Product, communication Communication, onStatusChanged func(*Status), ) *Device
NewDevice creates a new instance of Device.
func (*Device) GetHashes ¶
func (device *Device) GetHashes(displayFirmwareHash, displaySigningKeydataHash bool) ( []byte, []byte, error)
GetHashes queries the device for the firmware and signing keydata hashes. If the display flags are true, the hashes are also shown on the device screen.
func (*Device) ScreenRotate ¶
ScreenRotate rotates the device screen.
func (*Device) SetShowFirmwareHashEnabled ¶
SetShowFirmwareHashEnabled returns whether the bootloader will automatically show the firmware hash on boot.
func (*Device) ShowFirmwareHashEnabled ¶
ShowFirmwareHashEnabled returns whether the bootloader will automatically show the firmware hash on boot.
func (*Device) SignedFirmwareVersion ¶
SignedFirmwareVersion returns the monotonic firmware version contained in the signed firmware format.
func (*Device) UpgradeFirmware ¶
UpgradeFirmware uploads a signed bitbox02 firmware release to the device.