View | Details | Raw Unified | Return to bug 2146
Collapse All | Expand All

(-)ns-allinone-3.23/ns-3.23/src/wave/examples/wave-simple-device.cc (-17 / +10 lines)
 Lines 17-22    Link Here 
17
 */
17
 */
18
#include "ns3/node.h"
18
#include "ns3/node.h"
19
#include "ns3/packet.h"
19
#include "ns3/packet.h"
20
#include "ns3/simulator.h"
20
#include "ns3/simulator.h"
21
#include "ns3/node-container.h"
21
#include "ns3/node-container.h"
22
#include "ns3/net-device-container.h"
22
#include "ns3/net-device-container.h"
23
23
 Lines 115-127    Link Here 
115
  seqTs.SetSeq (seq);
116
  seqTs.SetSeq (seq);
116
  p->AddHeader (seqTs);
117
  p->AddHeader (seqTs);
117
  sender->SendX  (p, bssWildcard, WSMP_PROT_NUMBER, txInfo);
118
  sender->SendX  (p, bssWildcard, WSMP_PROT_NUMBER, txInfo);
118
119
  Ptr<Packet> p2  = Create<Packet> (100);
120
  SeqTsHeader seqTs2;
121
  seqTs2.SetSeq (seq + 1);
122
  p2->AddHeader (seqTs2);
123
  receiver->SendX  (p2, bssWildcard, WSMP_PROT_NUMBER, txInfo);
124
125
}
119
}
126
120
127
void
121
void
 Lines 140-158    Link Here 
140
134
141
  // send WSMP packets
135
  // send WSMP packets
142
  // the first packet will be queued currently and be transmitted in next SCH interval
136
  // the first packet will be queued currently and be transmitted in next SCH interval
143
  //Simulator::Schedule (Seconds (1.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, SCH1, 1);
137
  Simulator::Schedule (Seconds (1.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, SCH1, 1);
144
  // the second packet will be queued currently and then be transmitted , because of in the CCH interval.
138
  // the second packet will be queued currently and then be transmitted , because of in the CCH interval.
145
  Simulator::Schedule (Seconds (1.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, CCH, 2);
139
  Simulator::Schedule (Seconds (1.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, CCH, 2);
146
  // the third packet will be dropped because of no channel access for SCH2.
140
  // the third packet will be dropped because of no channel access for SCH2.
147
  //Simulator::Schedule (Seconds (1.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, SCH2, 3);
141
  Simulator::Schedule (Seconds (1.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, SCH2, 3);
148
142
149
  // release SCH access
143
  // release SCH access
150
  //Simulator::Schedule (Seconds (2.0), &WaveNetDevice::StopSch, sender, SCH1);
144
  Simulator::Schedule (Seconds (2.0), &WaveNetDevice::StopSch, sender, SCH1);
151
  //Simulator::Schedule (Seconds (2.0), &WaveNetDevice::StopSch, receiver, SCH1);
145
  Simulator::Schedule (Seconds (2.0), &WaveNetDevice::StopSch, receiver, SCH1);
152
  // the fourth packet will be queued and be transmitted because of default CCH access assigned automatically.
146
  // the fourth packet will be queued and be transmitted because of default CCH access assigned automatically.
153
  //Simulator::Schedule (Seconds (3.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, CCH, 4);
147
  Simulator::Schedule (Seconds (3.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, CCH, 4);
154
  // the fifth packet will be dropped because of no SCH1 access assigned
148
  // the fifth packet will be dropped because of no SCH1 access assigned
155
  //Simulator::Schedule (Seconds (3.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, SCH1, 5);
149
  Simulator::Schedule (Seconds (3.0), &WaveNetDeviceExample::SendOneWsmpPacket,  this, SCH1, 5);
156
150
157
  Simulator::Stop (Seconds (5.0));
151
  Simulator::Stop (Seconds (5.0));
158
  Simulator::Run ();
152
  Simulator::Run ();
159
153
 Lines 257-267    Link Here 
257
main (int argc, char *argv[])
251
main (int argc, char *argv[])
258
{
252
{
259
  example.SendWsmpExample ();
253
  example.SendWsmpExample ();
260
  std::cout << "run WAVE IP routing service case:" << std::endl;
254
  NS_LOG_UNCOND ("run WAVE IP routing service case:");
261
  //example.SendIpExample ();
255
  example.SendIpExample ();
262
  std::cout << "run WAVE WSA routing service case:" << std::endl;
256
  NS_LOG_UNCOND ("run WAVE WSA routing service case:");
263
  //example.SendWsaExample ();
257
  example.SendWsaExample ();
264
  return 0;
258
  return 0;
265
}
259
}
(-)ns-allinone-3.23/ns-3.23/src/wave/model/default-channel-scheduler.cc (-3 / +8 lines)
 Lines 157-165    Link Here 
157
        }
157
        }
158
    }
158
    }
159
159
160
  // if we need immediately switch SCH in CCHI, or we are in SCHI now,
160
  // if we need immediately switch to AlternatingAccess,
161
  // we switch to specific SCH.
161
  // we switch to specific SCH.
162
  if ((immediate || m_coordinator->IsSchInterval ()))
162
  if ((immediate && m_coordinator->IsSchInterval ()))
163
    {
163
    {
164
      NS_ASSERT (m_channelNumber == CCH);
164
      NS_ASSERT (m_channelNumber == CCH);
165
      SwitchToNextChannel (CCH, sch);
165
      SwitchToNextChannel (CCH, sch);
 Lines 329-335    Link Here 
329
    }
329
    }
330
  // CCH MAC is to attach single-PHY device and wake up for transmission.
330
  // CCH MAC is to attach single-PHY device and wake up for transmission.
331
  Ptr<OcbWifiMac> cchMacEntity = m_device->GetMac (CCH);
331
  Ptr<OcbWifiMac> cchMacEntity = m_device->GetMac (CCH);
332
  m_phy->SetChannelNumber (CCH);
332
  if (Now().GetMilliSeconds() != 0)
333
    {
334
	  m_phy->SetChannelNumber (CCH);
335
	  Time switchTime = m_phy->GetChannelSwitchDelay ();
336
	  cchMacEntity->MakeVirtualBusy (switchTime);
337
    }
333
  cchMacEntity->SetWifiPhy (m_phy);
338
  cchMacEntity->SetWifiPhy (m_phy);
334
  cchMacEntity->Resume ();
339
  cchMacEntity->Resume ();
335
340

Return to bug 2146