Initialize LMIC_init() Idle LMIC has code for class A, and class B devices. But nobody uses class B LMIC_sendWithCallback() &&

deviceAddr != 0 Normal Class A Transmit RX1 RX2 Prepare to send Wait for RX1 Wait for RX2 TX complete Prepare frame Prepare

MAC frame Post RX If valid application message, deliver to app LMIC_reset() Internally driven based

on when it's OK to send. No downlink received No Retrans;

txDone() no downlink

received Downlink received Downlink received txDone() MAC downlink needs

reply; txDone() Retransmit

needed Join Prepare Join Request Prepare to send Transmit Wait for Join RX1 RX1 Wait for Join RX2 RX2 Process Join Accept JOIN TX Complete JOIN Failed LMIC_reset()