LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 University of Washington | 3 * Copyright (c) 2009 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 return m_cw; | 336 return m_cw; |
337 } | 337 } |
338 Time | 338 Time |
339 UanMacCw::GetSlotTime (void) | 339 UanMacCw::GetSlotTime (void) |
340 { | 340 { |
341 return m_slotTime; | 341 return m_slotTime; |
342 } | 342 } |
343 void | 343 void |
344 UanMacCw::PhyRxPacketGood (Ptr<Packet> packet, double sinr, UanTxMode mode) | 344 UanMacCw::PhyRxPacketGood (Ptr<Packet> packet, double sinr, UanTxMode mode) |
345 { | 345 { |
| 346 NS_UNUSED(sinr); |
346 UanHeaderCommon header; | 347 UanHeaderCommon header; |
347 packet->RemoveHeader (header); | 348 packet->RemoveHeader (header); |
348 | 349 |
349 if (header.GetDest () == m_address || header.GetDest () == UanAddress::GetBroa
dcast ()) | 350 if (header.GetDest () == m_address || header.GetDest () == UanAddress::GetBroa
dcast ()) |
350 { | 351 { |
351 m_forwardUpCb (packet, header.GetSrc ()); | 352 m_forwardUpCb (packet, header.GetSrc ()); |
352 } | 353 } |
353 } | 354 } |
354 void | 355 void |
355 UanMacCw::PhyRxPacketError (Ptr<Packet> packet, double sinr) | 356 UanMacCw::PhyRxPacketError (Ptr<Packet> packet, double sinr) |
356 { | 357 { |
357 | 358 NS_UNUSED(sinr); |
358 } | 359 } |
359 void | 360 void |
360 UanMacCw::SaveTimer (void) | 361 UanMacCw::SaveTimer (void) |
361 { | 362 { |
362 NS_LOG_DEBUG ("Time " << Simulator::Now ().GetSeconds () << " Addr " << GetAdd
ress () << " Saving timer (Delay = " << (m_savedDelayS = m_sendTime - Simulator:
:Now ()).GetSeconds () << ")"); | 363 NS_LOG_DEBUG ("Time " << Simulator::Now ().GetSeconds () << " Addr " << GetAdd
ress () << " Saving timer (Delay = " << (m_savedDelayS = m_sendTime - Simulator:
:Now ()).GetSeconds () << ")"); |
363 NS_ASSERT (m_pktTx); | 364 NS_ASSERT (m_pktTx); |
364 NS_ASSERT (m_sendTime >= Simulator::Now ()); | 365 NS_ASSERT (m_sendTime >= Simulator::Now ()); |
365 m_savedDelayS = m_sendTime - Simulator::Now (); | 366 m_savedDelayS = m_sendTime - Simulator::Now (); |
366 Simulator::Cancel (m_sendEvent); | 367 Simulator::Cancel (m_sendEvent); |
367 | 368 |
(...skipping 21 matching lines...) Expand all Loading... |
389 NS_LOG_DEBUG ("Time " << Simulator::Now ().GetSeconds () << " Addr " << GetAdd
ress () << " Transmitting "); | 390 NS_LOG_DEBUG ("Time " << Simulator::Now ().GetSeconds () << " Addr " << GetAdd
ress () << " Transmitting "); |
390 NS_ASSERT (m_state == RUNNING); | 391 NS_ASSERT (m_state == RUNNING); |
391 m_state = TX; | 392 m_state = TX; |
392 m_phy->SendPacket (m_pktTx,m_pktTxProt); | 393 m_phy->SendPacket (m_pktTx,m_pktTxProt); |
393 m_pktTx = 0; | 394 m_pktTx = 0; |
394 m_sendTime = Seconds (0); | 395 m_sendTime = Seconds (0); |
395 m_savedDelayS = Seconds (0); | 396 m_savedDelayS = Seconds (0); |
396 } | 397 } |
397 | 398 |
398 } // namespace ns3 | 399 } // namespace ns3 |
LEFT | RIGHT |