Skip to content

Commit

Permalink
Merge pull request #900 from StevenCellist/master
Browse files Browse the repository at this point in the history
[LoRaWAN] Expose downlink framecounters
  • Loading branch information
jgromes authored Dec 9, 2023
2 parents a30d3da + fc8d80c commit fa90542
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ uplink KEYWORD2
downlink KEYWORD2
sendReceive KEYWORD2
setDeviceStatus KEYWORD2
getFcntUp KEYWORD2
getNFcntDown KEYWORD2
getAFcntDown KEYWORD2
setDatarate KEYWORD2
setADR KEYWORD2
setTxPower KEYWORD2
Expand Down
8 changes: 8 additions & 0 deletions src/protocols/LoRaWAN/LoRaWAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions src/protocols/LoRaWAN/LoRaWAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fa90542

Please sign in to comment.