TheThingsNetwork / arduino-device-lib

Arduino Library for TTN Devices
MIT License
207 stars 96 forks source link

Always sync baud on reset and after module reset #223

Closed alexbn71 closed 6 years ago

alexbn71 commented 6 years ago

When the MCU baud rate is different from default it is necessary to "autobaud" again after the module reset. Also, the response message after a reset is not readble if the MCU is working on a different baud rate. For this reason it it neccessary to issue another "autobaud" and a SYS_GET_VER to leave unchanged the behaviour of this function, that is reply with module informations.

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

johanstokking commented 6 years ago

Thanks for reporting, we'll be reviewing this!

johanstokking commented 6 years ago

Closes #219

alexbn71 commented 6 years ago

You mean this way?

johanstokking commented 6 years ago

Well, we don't need the length of the first call. Since we're writing to buffer anyway, it may be clean to at least read it. Can you revert back to your first implementation? That's a bit cleaner than this one

alexbn71 commented 6 years ago

Although it is not generally used I prefer to keep the statement as a reminder that there is a return value...