decodeControl function
Decode the JSON object of a control frame, or return null if it isn't
one.
Implementation
Map<String, Object?>? decodeControl(List<int> payload) {
try {
final message = jsonDecode(utf8.decode(payload));
return message is Map<String, Object?> ? message : null;
} on FormatException {
return null;
}
}