A sample implementation of OTAs using Bytebeam HTTP API. See https://cloud.bytebeam.io/device-apis/apidoc/index.html for documentation.
This class has the following methods:
-
static BytebeamSdk parse(String creds)
Parse and validate a credentials string you receive when provisioning a device on our platform. -
Future<AvailableUpdate?> fetchAvailableUpdate()
Fetch current update. Returns null if no update is available. -
Future<Uint8List> downloadFirmware(String version)
Takes the version of the firmware and securely downloads it. -
Future<void> uploadMessage({required String stream, required Map<String, dynamic> fields})
Upload a message to a stream. When responding to actions, you need to send a message to theaction_status
stream with fields (action_id
,state
,progress
, anderrors
(optional))
All of these methods throw a string in case of error.