onDataReceived method
void
onDataReceived()
override
Implementation
@override
void onDataReceived(String deviceId, String serviceUuid,
String characteristicUuid, Uint8List data) {
String uuid = characteristicUuid.toLowerCase();
String hex = data.toHex(withSpace: true);
if (Uuids.tiOADImageIdentify == (uuid)) {
_print("Image Identify Rx: $_deviceId [$hex]");
int status = data[0];
if (status == 0) {
_writeCtrlCMD(_ctrlCmdStartOADProcess);
} else {
_print(
"Image Identify Error($status): ${OADStatus.getMessage(status)}");
mListener?.onStatusChange(deviceId, status);
}
} else if (Uuids.tiOADControlPoint == uuid) {
//_print("Image Control Point Rx: $hex");
_handleControlPointResponse(deviceId, data);
}
}