Skip to content

Commit e0e5baa

Browse files
committed
change mqtt message payload decoding
1 parent 043bc74 commit e0e5baa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ doc/api/
1919
/example/
2020
/coverage/
2121
/bin/
22+
.DS_Store

lib/src/core/extension.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ extension MqttClientX on MqttClient {
6161
.updates
6262
?.expand((events) => events)
6363
?.asyncMap((event) {
64-
var _payload = event.payload as MqttPublishMessage;
65-
var payload =
66-
MqttPublishPayload.bytesToStringAsString(_payload.payload.message);
64+
var p = event.payload as MqttPublishMessage;
65+
var m = p.payload.message;
66+
var payload = utf8.decode(m);
67+
6768
return tuple2(event.topic, payload);
6869
});
6970
}

0 commit comments

Comments
 (0)