payloadString property
The payload of this CoAP message in string representation.
Implementation
String get payloadString {
final payload = this.payload;
if (payload != null && payload.isNotEmpty) {
try {
final ret = _utfDecoder.convert(payload);
return ret;
} on FormatException catch (_) {
// The payload may be incomplete, if so and the conversion
// fails indicate this.
return '<<<< Payload incomplete >>>>>';
}
}
return '';
}
Sets the payload from a string with a default media type
Implementation
set payloadString(final String value) =>
setPayloadMedia(value, CoapMediaType.textPlain);