Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposition to fix #163 #164

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion model/end-device-lorawan-mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,16 @@ 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 +628,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