Closed johanstokking closed 7 years ago
I couldn't sleep tonight and had an idea for a Message class that could contain any number of values, encoded in minimal bytes based on max range and min precision.
https://github.com/TheThingsNetwork/arduino-device-lib/wiki/Proposal:-Message-Class
@FokkeZB this is what protobufs will be for 👍
This allows for a generic, reusable Message
that contains many optional fields and arrays for custom data. The device sets the fields it needs and the protobuf marshaler only puts the used values in the buffer with a tiny header. It also supports variable length integers.
I have a demo ready shortly.
@FokkeZB see some example code in #81. The file https://github.com/johanstokking/ttn-protobuf-demo/blob/master/api/measurement.proto contains required
fields, but they will be optional
and a long list of things we can send. We can also send variable length arrays of analog readings, but putting values in the right fields helps upstream.
wow, I did quite some C coding lately, but that puzzles me 😛
Done by #108
E.g.: