Skip to content

Commit

Permalink
Fix certification of LinkADRReq: don't set ADRACKReq eagerly
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Aug 17, 2019
1 parent 59192e7 commit bfe662a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/lmic/lmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,9 @@ applyAdrRequests(
changes |= setDrTxpow(DRCHG_NWKCMD, dr, pow2dBm(p1));
}

LMIC.adrChanged = changes; // move the ADR FSM up to "time to request"
// Certification doesn't like this, but it makes the device happier with TTN.
// LMIC.adrChanged = changes; // move the ADR FSM up to "time to request"

return response_fit;
}

Expand Down Expand Up @@ -1823,7 +1825,7 @@ static void buildDataFrame (void) {
}
LMIC.frame[OFF_DAT_HDR] = HDR_FTYPE_DAUP | HDR_MAJOR_V1;
LMIC.frame[OFF_DAT_FCT] = (LMIC.dnConf | LMIC.adrEnabled
| (LMIC.adrAckReq >= LINK_CHECK_CONT ? FCT_ADRARQ : 0)
| (LMIC.adrAckReq >= LINK_CHECK_CONT ? FCT_ADRACKReq : 0)
| (end-OFF_DAT_OPTS));
os_wlsbf4(LMIC.frame+OFF_DAT_ADDR, LMIC.devaddr);

Expand Down
10 changes: 5 additions & 5 deletions src/lmic/lorabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,11 @@ enum {
};
enum {
// Bitfields in frame control octet
FCT_ADREN = 0x80,
FCT_ADRARQ = 0x40,
FCT_ACK = 0x20,
FCT_MORE = 0x10, // also in DN direction: Class B indicator
FCT_OPTLEN = 0x0F,
FCT_ADREN = 0x80,
FCT_ADRACKReq = 0x40,
FCT_ACK = 0x20,
FCT_MORE = 0x10, // also in DN direction: Class B indicator
FCT_OPTLEN = 0x0F,
};
enum {
// In UP direction: signals class B enabled
Expand Down

0 comments on commit bfe662a

Please sign in to comment.