deserializePPT method
Converts a uint8 data into a PPT Payload Object
Implementation
@override
PPTPayload? deserializePPT(Uint8List binPayload) {
List<dynamic>? arguments;
Map<String, dynamic>? argumentsKeywords;
final decodedMessage = cbor.decode(binPayload);
if (decodedMessage is CborMap) {
if (decodedMessage[CborString('args')] != null &&
decodedMessage[CborString('args')] is CborList) {
arguments = (decodedMessage[CborString('args')] as CborList).toObject()
as List<dynamic>;
}
if (decodedMessage[CborString('kwargs')] != null &&
decodedMessage[CborString('kwargs')] is CborMap) {
argumentsKeywords = Map.castFrom<dynamic, dynamic, String, dynamic>(
(decodedMessage[CborString('kwargs')] as CborMap).toObject()
as Map<dynamic, dynamic>);
}
return PPTPayload(
arguments: arguments, argumentsKeywords: argumentsKeywords);
}
return null;
}