Closed matthias-bs closed 1 year ago
I don't see why we can't have a method like that, do you want to open a pull request?
Sure! Which approach would you prefer: keeping a variable size
separately from the buffer or use a variable offset
which is also used as follows:
void LoraEncoder::writeUint32(uint32_t i) {
_intToBytes(_buffer+_offset, i, 4);
_offset += 4;
}
I would prefer the latter.
Thanks for the ultra quick reply!
I think the offset approach is a tad nicer, as the variable is actually used in all cases instead of carrying it along only for this case?
Thank you very much for accepting the PR. Are you planning a new release soon?
Created 3.2.0 just now.
Yes, but you did not update library.properties... ;-)
3.2.1
Thanks a lot!
I am using LoraEncoder instead of LoraMessage, because a statically allocated buffer is perfectly fine for me. Having a getLength() method would be greatly appreciated!
In my application, the data written to the buffer is configuration-dependent and I would like to avoid counting bytes in a second place.