23 #include "ns3/simulator.h"
24 #include "ns3/socket.h"
25 #include "ns3/wifi-phy.h"
71 for (std::map<uint32_t,
Ptr<OcbWifiMac>>::iterator i = macs.begin(); i != macs.end(); ++i)
92 uint8_t oibytes[5] = {0x00, 0x50, 0xC2, 0x4A, 0x40};
182 if (!scheduler->IsChannelAccessAssigned(
channel))
204 mac->SendVsc(vsc, peer, oi);
211 for (std::vector<VsaWork*>::iterator i =
m_vsas.begin(); i !=
m_vsas.end(); ++i)
213 if (!(*i)->repeat.IsExpired())
215 (*i)->repeat.Cancel();
227 for (std::vector<VsaWork*>::iterator i =
m_vsas.begin(); i !=
m_vsas.end();)
229 if ((*i)->channelNumber == channelNumber)
231 if (!(*i)->repeat.IsExpired())
233 (*i)->repeat.Cancel();
250 for (std::vector<VsaWork*>::iterator i =
m_vsas.begin(); i !=
m_vsas.end();)
254 if (!(*i)->repeat.IsExpired())
256 (*i)->repeat.Cancel();
289 uint32_t channelNumber =
mac->GetWifiPhy()->GetChannelNumber();
a polymophic address class
Time NeedTimeToCchInterval(Time duration=Seconds(0.0)) const
Time NeedTimeToSchInterval(Time duration=Seconds(0.0)) const
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
A base class which provides memory management and object aggregation.
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
uint8_t GetManagementId() const
Ptr< Packet > Copy() const
performs a COW copy of the packet.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
indicates whether the socket has a priority set.
void SetPriority(uint8_t priority)
Set the tag's priority.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission.
void RemoveAll()
cancel all VSA transmissions
void SetWaveVsaCallback(Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > vsaCallback)
Set wave vsa callback function.
void DoInitialize() override
Initialize() implementation.
Ptr< WaveNetDevice > m_device
the device
static const uint32_t VSA_REPEAT_PERIOD
A number of VSA frames will be transmitted repeatedly during the period of 5s.
void DoRepeat(VsaWork *vsa)
void DoDispose() override
Destructor implementation.
bool ReceiveVsc(Ptr< WifiMac > mac, const OrganizationIdentifier &oi, Ptr< const Packet > vsc, const Address &src)
void DoSendVsa(VsaTransmitInterval interval, uint32_t channel, Ptr< Packet > vsc, OrganizationIdentifier oi, Mac48Address peer)
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > m_vsaReceived
VSA received callback.
static TypeId GetTypeId()
Get the type ID.
std::vector< VsaWork * > m_vsas
VSAs.
void RemoveByChannel(uint32_t channelNumber)
void RemoveByOrganizationIdentifier(const OrganizationIdentifier &oi)
void SendVsa(const VsaInfo &vsaInfo)
Ptr< ChannelScheduler > GetChannelScheduler() const
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs() const
Ptr< ChannelCoordinator > GetChannelCoordinator() const
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
Ptr< ChannelManager > GetChannelManager() const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
VsaTransmitInterval
indicate which interval the VSA frames will be transmitted in.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static const OrganizationIdentifier oi_1609
OI for IEEE standard 1609.
static const uint8_t oi_bytes_1609[5]
OI bytes for use in organization identifier.
uint8_t managementId
management ID
VsaTransmitInterval sendInterval
send interval
uint32_t channelNumber
channel number
uint8_t repeatRate
repeat rate
OrganizationIdentifier oi
OI.
Time repeatPeriod
repeat period
OrganizationIdentifier oi
OI.
VsaTransmitInterval sentInterval
VSA transmit interval.
uint32_t channelNumber
channel number