lorawan.cpp: disable setLinkCheckMode & setDrTxpow

This commit is contained in:
Verkehrsrot 2019-09-19 16:13:48 +02:00
parent c8531ca466
commit 79e54774f1

View File

@ -540,7 +540,8 @@ void lmictask(void *pvParameters) {
os_init(); // initialize lmic run-time environment os_init(); // initialize lmic run-time environment
LMIC_reset(); // initialize lmic MAC LMIC_reset(); // initialize lmic MAC
LMIC_setLinkCheckMode(0); // LMIC_setLinkCheckMode(0);
// This tells LMIC to make the receive windows bigger, in case your clock is // This tells LMIC to make the receive windows bigger, in case your clock is
// faster or slower. This causes the transceiver to be earlier switched on, // faster or slower. This causes the transceiver to be earlier switched on,
// so consuming more power. You may sharpen (reduce) CLOCK_ERROR_PERCENTAGE // so consuming more power. You may sharpen (reduce) CLOCK_ERROR_PERCENTAGE
@ -548,13 +549,6 @@ void lmictask(void *pvParameters) {
#ifdef CLOCK_ERROR_PROCENTAGE #ifdef CLOCK_ERROR_PROCENTAGE
LMIC_setClockError(MAX_CLOCK_ERROR * CLOCK_ERROR_PROCENTAGE / 100); LMIC_setClockError(MAX_CLOCK_ERROR * CLOCK_ERROR_PROCENTAGE / 100);
#endif #endif
// Set the data rate to Spreading Factor 7. This is the fastest supported
// rate for 125 kHz channels, and it minimizes air time and battery power.
// Set the transmission power to 14 dBi (25 mW).
LMIC_setDrTxpow(DR_SF7, 14);
// register a callback for downlink messages. We aren't trying to write
// reentrant code, so pUserData is NULL.
LMIC_registerRxMessageCb(myRxCallback, NULL);
#if defined(CFG_US915) || defined(CFG_au921) #if defined(CFG_US915) || defined(CFG_au921)
// in the US, with TTN, it saves join time if we start on subband 1 // in the US, with TTN, it saves join time if we start on subband 1
@ -564,6 +558,15 @@ void lmictask(void *pvParameters) {
LMIC_selectSubBand(1); LMIC_selectSubBand(1);
#endif #endif
// Set the data rate to Spreading Factor 7. This is the fastest supported
// rate for 125 kHz channels, and it minimizes air time and battery power.
// Set the transmission power to 14 dBi (25 mW).
// LMIC_setDrTxpow(DR_SF7, 14);
// register a callback for downlink messages. We aren't trying to write
// reentrant code, so pUserData is NULL.
LMIC_registerRxMessageCb(myRxCallback, NULL);
while (1) { while (1) {
os_runloop_once(); // execute lmic scheduled jobs and events os_runloop_once(); // execute lmic scheduled jobs and events
delay(2); // yield to CPU delay(2); // yield to CPU