Azure / azure-iot-explorer

Cross-platform UI for interacting with devices attached to Azure IoT Hub. This tool is meant for learning and testing, not for production environment.
MIT License
224 stars 73 forks source link

[DRAFT] Custom decoders #544

Closed shahm5 closed 2 years ago

shahm5 commented 2 years ago

A very rough draft POC of custom message decoding using Protobuf (#383) https://protobufjs.github.io/protobuf.js/index.html

Some next steps

Thank you for contributing to the Azure IoT Explorer!

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

shahm5 commented 2 years ago

Sample .proto file (the corresponding type would be testpackage.TestMessage)

package testpackage;
syntax = "proto3";

message TestMessage {
    string test_field = 1; // becomes testField
}

Sample message encoded using this file new Message(new Buffer([10,13,65,119,101,115,111,109,101,83,116,114,105,110,103]));

Decodes as

{
    "testField": "AwesomeString"
}
YingXue commented 2 years ago

Elsie is updating the pr to make it to production