Skip to content

Commit

Permalink
Disable retransmissions for internal flush uplinks
Browse files Browse the repository at this point in the history
In certain cases, the modem can send an internal uplink message to flush
pending MAC commands that need to be sent to the network server. Disable
retransmissions when sending such uplink so that the values configured
by the application through AT+REP or AT+RTYNUM.
  • Loading branch information
janakj committed May 31, 2022
1 parent 5066b60 commit 4648f56
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,16 @@ int lrw_send(uint8_t port, void *buffer, uint8_t length, bool confirmed)
// Sertting the port to 0, the payload buffer to NULL, and buffer size
// to 0 will send an uplink message with FOpts but no port or payload.

// Disable retransmissions for the internally generated flush uplink
// message.
r.Type = MIB_CHANNELS_NB_TRANS;
r.Param.ChannelsNbTrans = 1;
rc = LoRaMacMibSetRequestConfirm(&r);
if (rc != LORAMAC_STATUS_OK) {
log_debug("Could not configure retransmissions: %d", rc);
return rc;
}

mr.Type = MCPS_UNCONFIRMED;
mr.Req.Unconfirmed.fPort = 0;
mr.Req.Unconfirmed.fBuffer = NULL;
Expand Down

0 comments on commit 4648f56

Please sign in to comment.