Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of opcodes #22

Open
aparcar opened this issue Feb 17, 2019 · 3 comments
Open

Integration of opcodes #22

aparcar opened this issue Feb 17, 2019 · 3 comments

Comments

@aparcar
Copy link

aparcar commented Feb 17, 2019

Hi, great library, thanks for creating!

I'm working on a setup where used sensors may change over time, meaning a static decoding on the backend won't work. Searching for a solution I found things4u's message format - which isn't implemented anywhere.

The idea is to have 6 Bit prefixes announcing the type followed by a 2 Bit length field. The decode would read the first bite and may automatically add "temperature" or whatever as a dict key.

This would increase the message size by a single Byte per transported value but allows dynamic decoding.

A possible implementation could give the LoraMessage a parameter setting the use of opcodes, or not.

@joscha
Copy link
Member

joscha commented Feb 17, 2019

You may want to have a look at https://github.com/thesolarnomad/ttn-proto-utils and especially the proto format, which will be really low-cost byte-wise but brings all the flexibility you need.

@aparcar
Copy link
Author

aparcar commented Feb 17, 2019

I created a POV here #23

@aparcar
Copy link
Author

aparcar commented Feb 17, 2019

I guess proto is great, but somewhat more complicated for the cases I'm working on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants