Skip to content

Commit

Permalink
proposition to fix signetlabdei#163
Browse files Browse the repository at this point in the history
  • Loading branch information
klementc committed Apr 22, 2024
1 parent b866c0b commit 2c10c44
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion model/end-device-lorawan-mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,15 @@ EndDeviceLorawanMac::postponeTransmission(Time netxTxDelay, Ptr<Packet> packet)
NS_LOG_FUNCTION(this);
// Delete previously scheduled transmissions if any.
Simulator::Cancel(m_nextTx);
m_nextTx = Simulator::Schedule(netxTxDelay, &EndDeviceLorawanMac::DoSend, this, packet);
EventId eid = Simulator::Schedule(netxTxDelay, &EndDeviceLorawanMac::Send, this, packet);
// Checking if this is the transmission of a new packet
if (packet == m_retxParams.packet)
{
m_nextTx = eid;
} // this is not a retransmission
else {
m_nextTx = EventId();
}
NS_LOG_WARN("Attempting to send, but the aggregate duty cycle won't allow it. Scheduling a tx "
"at a delay "
<< netxTxDelay.GetSeconds() << ".");
Expand Down Expand Up @@ -619,6 +627,7 @@ EndDeviceLorawanMac::Shuffle(std::vector<Ptr<LogicalLoraChannel>> vector)
void
EndDeviceLorawanMac::resetRetransmissionParameters()
{
NS_LOG_FUNCTION(this);
m_retxParams.waitingAck = false;
m_retxParams.retxLeft = m_maxNumbTx;
m_retxParams.packet = nullptr;
Expand Down

0 comments on commit 2c10c44

Please sign in to comment.