How to check if a session is currently established or not / LMIC is still joining or not?
When using OTAA there are two ways that a join can be initiated:
- Implicity, by scheduling an uplink message which will then automatically start the join process.
- By explicitly calling
- Is there a simple and reliable way, e.g. by checking values in the LMIC structure or otherwise to check if LMIC is still joining (but the join has not yet completed)?
- Is it possible to check the following separately?:
- Check if a session is established or not.
- Check if LMIC is currently (still) joining or not.
If not, this apparently will have to be done using events:
While handling EV_JOINED, a global variable
static volatile bool isJoined = false) can be set to true.
isJoined variable can then be checked to see whether the device is joined / a session is currently established or not.
- In which cases and when should the
isJoinedvariable be set to false again?
(What can cause the session to be no longer valid?)