diff --git a/keywords.txt b/keywords.txt index 981d2133..065991a0 100644 --- a/keywords.txt +++ b/keywords.txt @@ -299,6 +299,9 @@ uplink KEYWORD2 downlink KEYWORD2 sendReceive KEYWORD2 setDeviceStatus KEYWORD2 +getFcntUp KEYWORD2 +getNFcntDown KEYWORD2 +getAFcntDown KEYWORD2 setDatarate KEYWORD2 setADR KEYWORD2 setTxPower KEYWORD2 diff --git a/src/protocols/LoRaWAN/LoRaWAN.cpp b/src/protocols/LoRaWAN/LoRaWAN.cpp index 575943c7..af9c77e8 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.cpp +++ b/src/protocols/LoRaWAN/LoRaWAN.cpp @@ -1335,6 +1335,14 @@ uint32_t LoRaWANNode::getFcntUp() { return(this->fcntUp); } +uint32_t LoRaWANNode::getNFcntDown() { + return(this->nFcntDown); +} + +uint32_t LoRaWANNode::getAFcntDown() { + return(this->aFcntDown); +} + uint32_t LoRaWANNode::generateMIC(uint8_t* msg, size_t len, uint8_t* key) { if((msg == NULL) || (len == 0)) { return(0); diff --git a/src/protocols/LoRaWAN/LoRaWAN.h b/src/protocols/LoRaWAN/LoRaWAN.h index 82960f53..47be7cb3 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.h +++ b/src/protocols/LoRaWAN/LoRaWAN.h @@ -527,6 +527,12 @@ class LoRaWANNode { /*! \brief Returns the last uplink's frame counter */ uint32_t getFcntUp(); + /*! \brief Returns the last network downlink's frame counter */ + uint32_t getNFcntDown(); + + /*! \brief Returns the last application downlink's frame counter */ + uint32_t getAFcntDown(); + /*! \brief Set uplink datarate. This should not be used when ADR is enabled. \param dr Datarate to use for uplinks.