adafruit / TinyLoRa

LoRaWAN Library
69 stars 38 forks source link

Fix corrupt message sends due to encryption #13

Closed brentru closed 6 years ago

brentru commented 6 years ago

In the examples, a fixed string is created to send the message "Hello LoRa" but when the message to be transmitted is processed, the contents of the data array passed to senData are destroyed during the encryption process.

https://github.com/adafruit/TinyLoRa/issues/11

I've addressed this by creating a local copy of the Data (tmpData) in each lora.sendData() call to preserve the contents of the original data sent to the sendData() function. The new, encrypted data (tmpData) is used to build the radio package, instead of Data.