mcci-catena / arduino-lorawan

User-friendly library for using arduino-lmic with The Things Network and other LoRaWAN® networks
MIT License
274 stars 54 forks source link

EV_JOINING should call initialize the state more completely. #176

Closed terrillmoore closed 3 years ago

terrillmoore commented 3 years ago

In Arduino_LoRaWAN::StandardEventProcessor(), in order to deal properly with saved state, we need to react to EV_JOINING and do some work.

  1. We need to call Arduino_LoRaWAN::NetBeginRegionInit() so that subbands and other quirks can get set.
  2. We need to store session info and state.

Otherwise clients don't know that they have to update the saved state, and the wrong subband mask can be set.