27 #include <ns3/object.h> 28 #include <ns3/traced-callback.h> 29 #include <ns3/traced-value.h> 30 #include <ns3/mac16-address.h> 31 #include <ns3/mac64-address.h> 32 #include <ns3/sequence-number.h> 33 #include <ns3/lr-wpan-phy.h> 34 #include <ns3/event-id.h> 78 namespace TracedValueCallback {
TracedValue< LrWpanMacState > m_lrWpanMacState
The current state of the MAC layer.
uint16_t m_dstPanId
Destination PAN identifier.
uint64_t m_aBaseSuperframeDuration
Length of a superframe in symbols.
void CheckQueue(void)
Check the transmission queue.
Class that implements the LR-WPAN Mac state machine.
void PlmeGetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id, LrWpanPhyPibAttributes *attribute)
IEEE 802.15.4-2006 section 6.2.2.6 PLME-GET.confirm Get attributes per definition from Table 23 in se...
Mac16Address m_dstAddr
Destination address.
void RemoveFirstTxQElement()
Remove the tip of the transmission queue, including clean up related to the last packet transmission...
Mac64Address m_srcExtAddr
Source extended address.
TracedCallback< Ptr< const Packet > > m_macTxOkTrace
The trace source fired when packets where successfully transmitted, that is an acknowledgment was rec...
LrWpanPibAttributeIdentifier
IEEE802.15.4-2006 PHY PIB Attribute Identifiers Table 23 in section 6.4.2.
Forward calls to a chain of Callback.
McpsDataConfirmCallback m_mcpsDataConfirmCallback
This callback is used to report data transmission request status to the upper layers.
std::deque< TxQueueElement * > m_txQueue
The transmit queue used by the MAC.
Mac64Address GetExtendedAddress(void) const
Get the extended address of this MAC.
Mac16Address m_dstAddr
Destination address.
uint8_t m_dstAddrMode
Destination address mode.
Mac64Address m_dstExtAddr
Destination extended address.
LrWpanAssociationStatus m_associationStatus
The current association status of the MAC layer.
Mac64Address m_dstExtAddr
Destination extended address.
virtual void DoDispose(void)
Destructor implementation.
TracedCallback< LrWpanMacState, LrWpanMacState > m_macStateLogger
A trace source that fires when the LrWpanMac changes states.
void SetShortAddress(Mac16Address address)
Set the short address of this MAC.
IEEE802.15.4-2006 PHY PIB Attributes Table 23 in section 6.4.2.
McpsDataIndicationCallback m_mcpsDataIndicationCallback
This callback is used to notify incoming packets to the upper layers.
void SetMcpsDataConfirmCallback(McpsDataConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p)
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU. ...
uint8_t m_numCsmacaRetry
The number of CSMA/CA retries used for sending the current packet.
uint8_t m_msduHandle
MSDU handle.
uint8_t m_msduHandle
MSDU handle.
uint16_t m_dstPanId
Destination PAN identifier.
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets are being sent down to L1.
Ptr< Packet > m_txPkt
The packet which is currently being sent by the MAC layer.
bool GetRxOnWhenIdle(void)
Check if the receiver will be enabled when the MAC is idle.
LrWpanAssociationStatus GetAssociationStatus(void) const
Get the current association status.
void SetLrWpanMacState(LrWpanMacState macState)
CSMA-CA algorithm calls back the MAC after executing channel assessment.
uint64_t m_macBeaconOrder
Specification of how often the coordinator transmits its beacon.
void SetMacMaxFrameRetries(uint8_t retries)
Set the macMaxFrameRetries attribute value.
void PlmeEdConfirm(LrWpanPhyEnumeration status, uint8_t energyLevel)
IEEE 802.15.4-2006 section 6.2.2.4 PLME-ED.confirm status and energy level.
TracedCallback< Ptr< const Packet > > m_promiscSnifferTrace
A trace source that emulates a promiscuous mode protocol sniffer connected to the device...
TracedCallback< Ptr< const Packet > > m_macTxEnqueueTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition...
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
uint64_t m_macSyncSymbolOffset
Symbol boundary is same as m_macBeaconTxTime.
Ptr< Packet > txQPkt
Queued packet.
bool PrepareRetransmission(void)
Check for remaining retransmissions for the packet currently being sent.
void PlmeCcaConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status.
EventId m_ackWaitTimeout
Scheduler event for the ACK timeout of the currently transmitted data packet.
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
The trace source fired when packets are dropped due to missing ACKs or because of transmission failur...
uint16_t GetPanId(void) const
Get the PAN id used by this MAC.
EventId m_setMacState
Scheduler event for a deferred MAC state change.
LrWpanMcpsDataConfirmStatus
Table 42 of 802.15.4-2006.
Helper structure for managing transmission queue elements.
bool m_macRxOnWhenIdle
Indication of whether the MAC sublayer is to enable its receiver during idle periods.
uint64_t m_macBeaconTxTime
The time that the device transmitted its last beacon frame, in symbol periods.
MCPS-DATA.confirm params.
void PdDataConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.1.2 Confirm the end of transmission of an MPDU to MAC.
uint8_t m_txOptions
Tx Options (bitfield)
uint8_t m_mpduLinkQuality
LQI value measured during reception of the MPDU.
void SetPhy(Ptr< LrWpanPhy > phy)
Set the underlying PHY for the MAC.
TracedCallback< Ptr< const Packet >, uint8_t, uint8_t > m_sentPktTrace
The trace source fired when packets are considered as successfully sent or the transmission has been ...
void PdDataIndication(uint32_t psduLength, Ptr< Packet > p, uint8_t lqi)
IEEE 802.15.4-2006 section 6.2.1.3 PD-DATA.indication Indicates the transfer of an MPDU from PHY to M...
uint8_t m_srcAddrMode
Source address mode.
LrWpanMcpsDataConfirmStatus m_status
The status of the last MSDU transmission.
LrWpanAddressMode m_srcAddrMode
Source address mode.
uint8_t m_retransmission
The number of already used retransmission for the currently transmitted packet.
Callback< void, McpsDataIndicationParams, Ptr< Packet > > McpsDataIndicationCallback
This callback is called after a Mcps has successfully received a frame and wants to deliver it to the...
Mac64Address m_selfExt
The extended address used by this MAC.
uint64_t GetMacAckWaitDuration(void) const
Get the macAckWaitDuration attribute value.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LrWpanAddressMode m_dstAddrMode
Destination address mode.
LrWpanAddressMode
table 80 of 802.15.4
uint64_t m_macSuperframeOrder
The length of the active portion of the outgoing superframe, including the beacon frame...
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
The trace source fired for packets successfully received by the device but dropped before being forwa...
Callback< void, McpsDataConfirmParams > McpsDataConfirmCallback
This callback is called after a McpsDataRequest has been called from the higher layer.
void SetRxOnWhenIdle(bool rxOnWhenIdle)
Set if the receiver should be enabled when the MAC is idle.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
bool m_macPromiscuousMode
Indicates if MAC sublayer is in receive all mode.
Mac16Address m_srcAddr
Source address.
This class can contain 16 bit addresses.
uint8_t m_dsn
The DSN of the received data frame.
LrWpanMac(void)
Default constructor.
TracedCallback< Ptr< const Packet > > m_snifferTrace
A trace source that emulates a non-promiscuous protocol sniffer connected to the device.
void SetExtendedAddress(Mac64Address address)
Set the extended address of this MAC.
uint8_t m_macMaxFrameRetries
The maximum number of retries allowed after a transmission failure.
uint8_t txQMsduHandle
MSDU Handle.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< LrWpanPhy > m_phy
The PHY associated with this MAC.
SequenceNumber8 m_macDsn
Sequence number added to transmitted data or MAC command frame, 00-ff.
An identifier for simulation events.
uint64_t m_aNumSuperframeSlots
Number of a superframe slots per superframe.
static const uint32_t aMinMPDUOverhead
The minimum number of octets added by the MAC sublayer to the PSDU.
LrWpanTxOption
Tx options.
void ChangeMacState(LrWpanMacState newState)
Change the current MAC state to the given new state.
Ptr< LrWpanCsmaCa > m_csmaCa
The CSMA/CA implementation used by this MAC.
LrWpanMacState
MAC states.
LrWpanAssociationStatus
table 83 of 802.15.4
uint8_t GetMacMaxFrameRetries(void) const
Get the macMaxFrameRetries attribute value.
TracedCallback< Ptr< const Packet > > m_macTxDequeueTrace
The trace source fired when packets are dequeued from the L3/l2 transmission queue.
uint16_t m_macPanId
16 bits id of PAN on which this device is operating.
void(* StateTracedCallback)(LrWpanMacState oldState, LrWpanMacState newState)
TracedCallback signature for LrWpanMacState change events.
void PlmeSetTRXStateConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.8 PLME-SET-TRX-STATE.confirm Set PHY state.
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
void SendAck(uint8_t seqno)
Send an acknowledgment packet for the given sequence number.
MCPS-DATA.request params.
A base class which provides memory management and object aggregation.
void AckWaitTimeout(void)
Handle an ACK timeout with a packet retransmission, if there are retransmission left, or a packet drop.
Ptr< LrWpanPhy > GetPhy(void)
Get the underlying PHY of the MAC.
Mac16Address m_shortAddress
The short address used by this MAC.
Mac16Address GetShortAddress(void) const
Get the short address of this MAC.
a unique identifier for an interface.
void SetCsmaCa(Ptr< LrWpanCsmaCa > csmaCa)
Set the CSMA/CA implementation to be used by the MAC.
void SetPanId(uint16_t panId)
Set the PAN id used by this MAC.
void PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id)
IEEE 802.15.4-2006 section 6.2.2.10 PLME-SET.confirm Set attributes per definition from Table 23 in s...
virtual void DoInitialize(void)
Initialize() implementation.
void(* SentTracedCallback)(Ptr< const Packet > packet, uint8_t retries, uint8_t backoffs)
TracedCallback signature for sent packets.
uint64_t m_aBaseSlotDuration
Length of a superframe slot in symbols.
uint16_t m_srcPanId
Source PAN identifier.
void SetAssociationStatus(LrWpanAssociationStatus status)
Set the current association status.
MCPS-DATA.indication params.
void SetMcpsDataIndicationCallback(McpsDataIndicationCallback c)
Set the callback for the indication of an incoming data packet.