thesolarnomad / lora-serialization

LoraWAN serialization/deserialization library for The Things Network
MIT License
164 stars 26 forks source link

Boolean Datatype #3

Closed Drasek closed 7 years ago

Drasek commented 7 years ago

Hello,

i really like this library and would love it another datatype: Boolean

It would be useful for stuff like "Battery Low: false/true" / "Something: on/off" / "Parking lot: occupied/free" and you could en/decode 8 Boolean datasets into 1 Byte.

message
    .addBoolean(true/false);

At the moment i have to use the uint8 datatype and do the bitshifting "by hand", it would be great to have this inside the library. Thank you very much!

joscha commented 7 years ago

sounds good to me - it could be a Bitmap type allowing for up to 8 booleans

joscha commented 7 years ago

Just implemented in 2.3.0