[LoRaWAN] Added check to not uplink in Rx slots
This commit is contained in:
parent
45c376bde6
commit
1ed22717d7
2 changed files with 9 additions and 3 deletions
|
@ -518,6 +518,11 @@
|
||||||
*/
|
*/
|
||||||
#define RADIOLIB_ERR_INVALID_CID (-1107)
|
#define RADIOLIB_ERR_INVALID_CID (-1107)
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief User requested to start uplink while still inside RX window.
|
||||||
|
*/
|
||||||
|
#define RADIOLIB_ERR_UPLINK_UNAVAILABLE (-1108)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\}
|
\}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -342,9 +342,10 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port) {
|
||||||
|
|
||||||
// check if sufficient time has elapsed since the last uplink
|
// check if sufficient time has elapsed since the last uplink
|
||||||
Module* mod = this->phyLayer->getMod();
|
Module* mod = this->phyLayer->getMod();
|
||||||
/*if(mod->hal->millis() - this->rxDelayStart < ) {
|
if(mod->hal->millis() - this->rxDelayStart < rxDelays[1]) {
|
||||||
|
// not enough time elapsed since the last uplink, we may still be in an RX window
|
||||||
}*/
|
return(RADIOLIB_ERR_UPLINK_UNAVAILABLE);
|
||||||
|
}
|
||||||
|
|
||||||
// build the uplink message
|
// build the uplink message
|
||||||
// the first 16 bytes are reserved for MIC calculation blocks
|
// the first 16 bytes are reserved for MIC calculation blocks
|
||||||
|
|
Loading…
Add table
Reference in a new issue