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