I’ve been sifting through various code examples on how to send data through LoRa but coming up a little short. I have been following the code for the mDot Box since it is sending decimal numbers and they are being received on NodeRed on my conduit. We will be sending data in a very similar fashion.
I understand the data has to be packaged in a vector of type uint8_t, what I am having a difficult time understanding is how it takes a float value (say 12.3456), cast that data as uint8_t elements in a vector and how to translate back into the original float value on the receiving end.
If anyone can shed some light on this, that would be a huge help. One idea I had was to multiply my float value by 100, 1000, etc. and store that integer value in the vector, send it, and divide it back into it’s decimal value. This method seems easier, however I know the person that wrote the code for the mDot Box is smart and did it for a reason.
Thanks!