From 53e9b9ee9d0bc59f612366da02dfa80b048dd2b5 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Sun, 18 Aug 2019 20:25:50 -0400 Subject: [PATCH] Fix #375: correct names, add back inadvertent drop of MCMD_BeaconInfoReq --- src/lmic/lmic.c | 10 ++++++++-- src/lmic/lorabase.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lmic/lmic.c b/src/lmic/lmic.c index 0f5ea251..a95bb94e 100644 --- a/src/lmic/lmic.c +++ b/src/lmic/lmic.c @@ -1844,6 +1844,12 @@ static void buildDataFrame (void) { LMIC.txDeviceTimeReqState = lmic_RequestTimeState_rx; } #endif // LMIC_ENABLE_DeviceTimeReq +#if !defined(DISABLE_BEACONS) && defined(ENABLE_MCMD_BeaconTimingAns) + if ( LMIC.bcninfoTries > 0 ) { + LMIC.frame[end+0] = MCMD_BeaconInfoReq; + end += 1; + } +#endif ASSERT(end <= OFF_DAT_OPTS+16); u1_t flen = end + (txdata ? 5+dlen : 4); @@ -1962,7 +1968,7 @@ bit_t LMIC_enableTracking (u1_t tryBcnInfo) { if( (LMIC.opmode & (OP_SCAN|OP_TRACK|OP_SHUTDOWN)) != 0 ) return 0; // already in progress or failed to enable // If BCN info requested from NWK then app has to take are - // of sending data up so that MCMD_BeaconTimingReq can be attached. + // of sending data up so that MCMD_BeaconInfoReq can be attached. if( (LMIC.bcninfoTries = tryBcnInfo) == 0 ) startScan(); return 1; // enabled @@ -2254,7 +2260,7 @@ static bit_t processDnData (void) { reportEventNoUpdate(EV_LINK_DEAD); // update? } #if !defined(DISABLE_BEACONS) - // If this falls to zero the NWK did not answer our MCMD_BeaconTimingReq commands - try full scan + // If this falls to zero the NWK did not answer our MCMD_BeaconInfoReq commands - try full scan if( LMIC.bcninfoTries > 0 ) { if( (LMIC.opmode & OP_TRACK) != 0 ) { reportEventNoUpdate(EV_BEACON_FOUND); // update? diff --git a/src/lmic/lorabase.h b/src/lmic/lorabase.h index d3b58101..c1ec1cdc 100644 --- a/src/lmic/lorabase.h +++ b/src/lmic/lorabase.h @@ -512,7 +512,7 @@ enum { // Class B MCMD_PingSlotInfoReq = 0x10, // u1: 7=RFU, 6-4:interval, 3-0:datarate MCMD_PingSlotChannelAns = 0x11, // u1: 7-1:RFU, 0:freq ok - MCMD_BeaconTimingReq = 0x12, // - (DEPRECATED) + MCMD_BeaconInfoReq = 0x12, // - (DEPRECATED) MCMD_BeaconFreqAns = 0x13, // u1: 7-1:RFU, 0:freq ok };