Uploaded image for project: 'Edgent'
  1. Edgent
  2. EDGENT-403

Wish IotDevice.events() exposed support for byte[] payloads

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Connectors
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dlaboss Dale LaBossiere
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: