diff --git a/src/lmic/lmic.c b/src/lmic/lmic.c index 7a1beecf..cf782fe9 100644 --- a/src/lmic/lmic.c +++ b/src/lmic/lmic.c @@ -711,7 +711,7 @@ static CONST_TABLE(u1_t, macCmdSize)[] = { static u1_t getMacCmdSize(u1_t macCmd) { if (macCmd < 2) return 0; - if (macCmd >= LENOF_TABLE(macCmdSize) - 2) + if ((macCmd - 2) >= LENOF_TABLE(macCmdSize)) return 0; return TABLE_GET_U1(macCmdSize, macCmd - 2); } @@ -1889,6 +1889,9 @@ static bit_t buildDataFrame (void) { LMIC.frame[OFF_DAT_HDR] = HDR_FTYPE_DAUP | HDR_MAJOR_V1; LMIC.frame[OFF_DAT_FCT] = (LMIC.dnConf | LMIC.adrEnabled | (sendAdrAckReq() ? FCT_ADRACKReq : 0) +#if !defined(DISABLE_PING) + | ((LMIC.opmode & OP_PINGABLE) ? FCT_CLASSB : 0) +#endif // ndef DISABLE_PING | (end-OFF_DAT_OPTS)); os_wlsbf4(LMIC.frame+OFF_DAT_ADDR, LMIC.devaddr); diff --git a/src/lmic/lmic_eu868.c b/src/lmic/lmic_eu868.c index f8d51d15..d77ab34e 100644 --- a/src/lmic/lmic_eu868.c +++ b/src/lmic/lmic_eu868.c @@ -236,7 +236,7 @@ ostime_t LMICeu868_nextTx(ostime_t now) { #if !defined(DISABLE_BEACONS) void LMICeu868_setBcnRxParams(void) { LMIC.dataLen = 0; - LMIC.freq = LMIC.channelFreq[LMIC.bcnChnl] & ~(u4_t)3; + LMIC.freq = FREQ_BCN; LMIC.rps = setIh(setNocrc(dndr2rps((dr_t)DR_BCN), 1), LEN_BCN); } #endif // !DISABLE_BEACONS