Restructuring/moved LMIC related calls inside TTN

1. Added comments clarifying functions
2. Does not yet default to TTN compatible single LoRa band format
3. Build will fail if component is not preconfigured (LoRa is disabled) and
a LMIC (LoRa) component call is made (not sure if this is good or bad?)
This commit is contained in:
Aaron Covrig
2020-06-14 22:29:45 -04:00
parent 8b28a72eec
commit 44a28a0364
2 changed files with 80 additions and 21 deletions

View File

@ -19,13 +19,6 @@
#include "TTNProvisioning.h"
#include "TTNLogging.h"
void LMIC_Controls::disableChannel(uint8_t channel){ LMIC_disableChannel( channel ); }
void LMIC_Controls::enableSubBand(uint8_t band){ LMIC_enableSubBand( band ); }
void LMIC_Controls::enableChannel(uint8_t channel){ LMIC_enableChannel( channel ); }
void LMIC_Controls::disableSubBand(uint8_t band){ LMIC_disableSubBand( band ); }
void LMIC_Controls::selectSubBand(uint8_t band){ LMIC_selectSubBand( band ); }
/**
* @brief Reason the user code is waiting
*/
@ -202,6 +195,7 @@ bool TheThingsNetwork::joinCore()
ttn_hal.enterCriticalSection();
waitingReason = eWaitingForJoin;
LMIC_startJoining();
LMIC_selectSubBand( 1 );
ttn_hal.wakeUp();
ttn_hal.leaveCriticalSection();
@ -271,6 +265,12 @@ void TheThingsNetwork::setRSSICal(int8_t rssiCal)
ttn_hal.rssiCal = rssiCal;
}
bool TheThingsNetwork::disableChannel(uint8_t channel){ return !LMIC_disableChannel( channel ); }
bool TheThingsNetwork::enableSubBand(uint8_t band){ return !LMIC_enableSubBand( band ); }
bool TheThingsNetwork::enableChannel(uint8_t channel){ return !LMIC_enableChannel( channel ); }
bool TheThingsNetwork::disableSubBand(uint8_t band){ return !LMIC_disableSubBand( band ); }
bool TheThingsNetwork::selectSubBand(uint8_t band){ return !LMIC_selectSubBand( band ); }
// --- Callbacks ---