startImageUpload method
Sends the first chunk of a firmware upload.
This is a low-level API. You are probably looking for uploadImage.
Implementation
Future<ImageUploadResponse> startImageUpload(
int image,
List<int> data,
int length,
List<int> sha256,
Duration timeout,
) {
return execute(
Message(
op: Operation.write,
group: _imgGroup,
id: _imgCmdUpload,
flags: 0,
data: CborMap({
CborString("image"): CborSmallInt(image),
CborString("data"): CborBytes(data),
CborString("len"): CborSmallInt(length),
CborString("off"): CborSmallInt(0),
CborString("sha"): CborBytes(sha256),
}),
),
timeout,
).unwrap().then((value) => ImageUploadResponse(value.data));
}