mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-07-31 03:00:07 +02:00
add transmit start for leo mock channels
This commit is contained in:
parent
aa4e5b5ef0
commit
20ad318cb9
8 changed files with 55 additions and 94 deletions
|
@ -152,4 +152,37 @@ MockChannel::GetPropagationLoss () const
|
|||
return m_propagationLoss;
|
||||
}
|
||||
|
||||
bool
|
||||
MockChannel::Deliver (
|
||||
Ptr<const Packet> p,
|
||||
Ptr<MockNetDevice> src,
|
||||
Ptr<MockNetDevice> dst,
|
||||
Time txTime)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << p << src->GetAddress () << dst->GetAddress () << txTime);
|
||||
Time delay = GetDelay (src, dst, txTime);
|
||||
|
||||
/* Check if there is LOS between the source and destination */
|
||||
if (GetPropagationLoss ()->CalcRxPower(1, src->GetMobilityModel(), dst->GetMobilityModel()) > 0)
|
||||
{
|
||||
Simulator::ScheduleWithContext (dst->GetNode ()->GetId (),
|
||||
delay,
|
||||
&MockNetDevice::Receive,
|
||||
dst,
|
||||
p->Copy (),
|
||||
src);
|
||||
|
||||
// Call the tx anim callback on the net device
|
||||
m_txrxMock (p, src, dst, txTime, delay);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_LOGIC (dst << " unreachable from " << src);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue