Skip to content

Commit

Permalink
Fix #375: correct names, add back inadvertent drop of MCMD_BeaconInfoReq
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Aug 19, 2019
1 parent 88af127 commit 53e9b9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/lmic/lmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion src/lmic/lorabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 53e9b9e

Please sign in to comment.