Details
-
Wish
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I had an application that wanted to publish device events having a byte[] payload. In this case it wanted to publish a png image.
I worked around the issue by MIME (base64) encoding the image and then having that string as an attribute in the JsonObject to publish. Of course the encoding utilized some additional CPU cycles and increased the payload size a bit.
MQTT supports publishing a byte[]. Edgent's MqttStreams.publish() exposes that. IotDevice.events() does not, hence neither does Edgent's MqttDevice. WIoTP supports byte[] payloads. Edgent's IotpDevice doesn't expose that capability.
Suggest adding something along the lines of:
IotDevice.events(TStream<T> stream, Function<T, String> topic, Function<T, byte[]> payload, Function<T, String> format, Function<T, int> qos)
and enhancing MqttDevice and IotpDevice accordingly, as well as IotGateway and IotpGateway.