DFUService
Exposes performing functionality for Device Firmware Upgrades on supported Last Lock BLE devices Class handles the entire bridge - device DFU process including DFU image fetching and validation, and conducting the firmware upgrade.
Validate and fetch
Assumption: As of internal-libs v1.2, only multi-image DFUs are supported. A .zip file is expected that contains the individual DFU images (application_core and network_core) along with a manifest.json. Failure to include manifest.json will result in the entire process getting aborted.
Note: To avoid deadlocking Last Lock device in DFU mode, enable DFU mode only if the DFU images pass the validation checks
Constructors
Functions
Checks if a DFU update is available for the given device. Queues a DEVICE_INFORMATION operation to trigger a heartbeat, waits for the firmware version, fetches the DFU image, and compares versions. Updates dfuAvailable, dfuImage, and dfuImageLoading. Runs mutually exclusively.
Exits install mode by sending a reboot command. If device has DFU service available, uses SMP group 1 (reboot). Otherwise, this method falls back to sending SMP reboot for firmware < 2.3.0
Starts the DFU process for the provided Device. This is called when the device is already in DFU mode. It sets states and allows for DFU to begin.
Error if returned will correspond to the BLE GATT error thrown by the device
Sends an oob command to the device. If device has DFU service available, uses SMP group 64. Otherwise, uses OOB characteristic.