20#ifndef LR_WPAN_MAC_BASE_H
21#define LR_WPAN_MAC_BASE_H
23#include <ns3/callback.h>
24#include <ns3/mac16-address.h>
25#include <ns3/mac64-address.h>
26#include <ns3/nstime.h>
27#include <ns3/object.h>
28#include <ns3/packet.h>
This class can contain 16 bit addresses.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Lr-wpan MAC layer abstraction.
void SetMcpsDataConfirmCallback(McpsDataConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
virtual void MlmePollRequest(MlmePollRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.14.2 MLME-POLL.request Prompts the device to request data from the co...
MlmeOrphanIndicationCallback m_mlmeOrphanIndicationCallback
This callback is used to indicate the reception of a orphan notification command.
MlmeGetConfirmCallback m_mlmeGetConfirmCallback
This callback is used to report the result of an attribute read request to the upper layers.
MlmeAssociateIndicationCallback m_mlmeAssociateIndicationCallback
This callback is used to indicate the reception of an association request command.
virtual void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p)=0
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.
MlmeSetConfirmCallback m_mlmeSetConfirmCallback
This callback is used to report the result of an attribute writing request to the upper layers.
virtual void MlmeOrphanResponse(MlmeOrphanResponseParams params)=0
IEEE 802.15.4-2011, section 6.2.7.2 MLME-ORPHAN.response Primitive used to initiatte a response to an...
MlmePollConfirmCallback m_mlmePollConfirmCallback
This callback is used to report the status after a device send data command request to the coordinato...
MlmeCommStatusIndicationCallback m_mlmeCommStatusIndicationCallback
This callback is instigated through a response primitive.
virtual void MlmeSyncRequest(MlmeSyncRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.13.1 MLME-SYNC.request Request to synchronize with the coordinator by...
virtual void MlmeGetRequest(MacPibAttributeIdentifier id)=0
IEEE 802.15.4-2006, section 7.1.6.1 MLME-GET.request Request information about a given PIB attribute.
~LrWpanMacBase() override
void SetMlmeSyncLossIndicationCallback(MlmeSyncLossIndicationCallback c)
Set the callback for the loss of synchronization with a coordinator.
McpsDataConfirmCallback m_mcpsDataConfirmCallback
This callback is used to report data transmission request status to the upper layers.
virtual void MlmeScanRequest(MlmeScanRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel s...
virtual void MlmeAssociateResponse(MlmeAssociateResponseParams params)=0
IEEE 802.15.4-2011, section 6.2.2.3 MLME-ASSOCIATE.response Primitive used to initiate a response to ...
void SetMlmeOrphanIndicationCallback(MlmeOrphanIndicationCallback c)
Set the callback for the indication to the reception of an orphan notification.
McpsDataIndicationCallback m_mcpsDataIndicationCallback
This callback is used to notify incoming packets to the upper layers.
virtual void MlmeStartRequest(MlmeStartRequestParams params)=0
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
MlmeScanConfirmCallback m_mlmeScanConfirmCallback
This callback is used to report the result of a scan on a group of channels for the selected channel ...
void SetMlmeCommStatusIndicationCallback(MlmeCommStatusIndicationCallback c)
Set the callback for the indication to a response primitive.
void SetMlmeAssociateConfirmCallback(MlmeAssociateConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
virtual void MlmeAssociateRequest(MlmeAssociateRequestParams params)=0
IEEE 802.15.4-2011, section 6.2.2.1 MLME-ASSOCIATE.request Request primitive used by a device to requ...
MlmeAssociateConfirmCallback m_mlmeAssociateConfirmCallback
This callback is used to report the status after a device request an association with a coordinator.
void SetMlmeStartConfirmCallback(MlmeStartConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
void SetMlmePollConfirmCallback(MlmePollConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
static TypeId GetTypeId()
Get the type ID.
MlmeSyncLossIndicationCallback m_mlmeSyncLossIndicationCallback
This callback is used to indicate the loss of synchronization with a coordinator.
void SetMlmeScanConfirmCallback(MlmeScanConfirmCallback c)
Set the callback for the confirmation of a data transmission request.
void SetMlmeGetConfirmCallback(MlmeGetConfirmCallback c)
Set the callback for the confirmation of an attempt to read an attribute.
MlmeBeaconNotifyIndicationCallback m_mlmeBeaconNotifyIndicationCallback
This callback is used to notify incoming beacon packets to the upper layers.
void SetMcpsDataIndicationCallback(McpsDataIndicationCallback c)
Set the callback for the indication of an incoming data packet.
void SetMlmeBeaconNotifyIndicationCallback(MlmeBeaconNotifyIndicationCallback c)
Set the callback for the indication of an incoming beacon packet.
virtual void MlmeSetRequest(MacPibAttributeIdentifier id, Ptr< MacPibAttributes > attribute)=0
IEEE 802.15.4-2011, section 6.2.11.1 MLME-SET.request Attempts to write the given value to the indica...
void SetMlmeSetConfirmCallback(MlmeSetConfirmCallback c)
Set the callback for the confirmation of an attempt to write an attribute.
MlmeStartConfirmCallback m_mlmeStartConfirmCallback
This callback is used to report the start of a new PAN or the begin of a new superframe configuration...
void SetMlmeAssociateIndicationCallback(MlmeAssociateIndicationCallback c)
Set the callback for the indication of an incoming associate request command.
MacPibAttributeIdentifier
IEEE 802.15.4-2006 PHY and MAC PIB Attribute Identifiers Table 23 and Table 86.
AddressMode
table 80 of 802.15.4
MlmeScanType
Table 30 of IEEE 802.15.4-2011.
MacStatus
The status of a confirm or an indication primitive as a result of a previous request.
@ macCoordShortAddress
The 16-bit short address assigned to the coordinator through which the device is associated.
@ macPanId
The 16-bit identifier of the Personal Area Network (PAN).
@ pCurrentChannel
RF channel used for transmissions and receptions.
@ macBsn
The sequence number added to the transmitted beacon frame.
@ macShortAddress
The short address of the device (16 bit address).
@ macSuperframeOrder
The length of the active portion of the outgoing superframe, including the beacon frame.
@ macAutoRequest
Indication of whether a device automatically sends a data request command if its address is listed in...
@ macBeaconOrder
Specification of how often the coordinator transmits its beacon.
@ macAckWaitDuration
Maximum number of symbols to wait for an acknowledgment.
@ macRxOnWhenIdle
Indication of whether the MAC is enabled during idle periods.
@ macBeaconPayloadLength
The length in octets of the beacon payload.
@ macPromiscuousMode
Indication of whether the MAC sublayer is in a promiscuous mode.
@ macBeaconTxTime
The time that the device transmitted its last beacome frame, in symbol periods.
@ macMaxCSMABackoff
The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access f...
@ pCurrentPage
The current channel page.
@ macMinBE
The minimum value of the backoff exponent (BE) in the CSMA-CA algorithm.
@ macExtendedAddress
The extended address of the device (64 bit address).
@ macBattLifeExtPeriods
In BLE mode, the number of backoff periods during which the the receiver is enabled after the IFS fol...
@ macGTSPermit
True if the PAN coordinator is to accept GTS requests.
@ macBattLifeExt
Indication of whether BLE, through the reduction of coordinator receiver operation time during the CA...
@ macResponseWaitTime
The maximum time in multiples of aBaseSuperframeDuration, a device shall wait for a response command ...
@ macMaxFrameRetries
The maximum number of retries allowed after a transmission failure.
@ macAssociationPermit
Indication of whether a coordinator is allowing association.
@ macDSN
The sequence number added to the transmitted data or MAC command frame.
@ macCoordExtendedAddress
The 64-bit address of the coordinator through which the device is associated.
@ macTransactionPersistenceTime
The maximum time (in unit periods) that a transaction is stored by a coordinator and indicated in its...
@ macBeaconPayload
The contents of the beacon payload.
@ CHANNEL_ACCESS_FAILURE
CHANNEL_ACCESS_FAILURE.
@ TRANSACTION_OVERFLOW
There is no capacity to store the transaction.
@ NO_BEACON
A scan operation failed to find any network beacons.
@ TX_ACTIVE
The transceiver was already enabled.
@ INVALID_GTS
Missing GTS transmit or undefined direction.
@ UNSUPPORTED_ATTRIBUTE
SET/GET request issued with a non supported ID.
@ NO_SHORT_ADDRESS
Failure due to unallocated 16-bit short address.
@ PAST_TIME
Rx enable request fail due to lack of time in superframe.
@ ACCESS_DENIED
PAN access denied.
@ BEACON_LOSS
The beacon was lost following a synchronization request.
@ PAN_ID_CONFLICT
PAN id conflict detected and informed to the coordinator.
@ DISABLE_TRX_FAILURE
The attempt to disable the transceier has failed.
@ LIMIT_REACHED
PAN descriptors stored reached max capacity.
@ TRACKING_OFF
This device is currently not tracking beacons.
@ READ_ONLY
SET/GET request issued for a read only attribute.
@ ON_TIME_TOO_LONG
RX enable request fail due to syms.
@ TRANSACTION_EXPIRED
The transaction expired and its information discarded.
@ SCAN_IN_PROGRESS
Scan failed because already performing another scan.
@ FRAME_TOO_LONG
Frame more than aMaxPHYPacketSize or too large for CAP or GTS.
@ OUT_OF_CAP
(Deprecated) See IEEE 802.15.4-2003
@ IMPROPER_KEY_TYPE
The key is not allowed to be used with that frame type.
@ DENIED
The GTS request has been denied by the PAN coordinator.
@ IMPROPER_SECURITY_LEVEL
Insufficient security level expected by the recipient.
@ INVALID_ADDRESS
Invalid source or destination address.
@ INVALID_HANDLE
When purging from TX queue handle was not found.
@ REALIGMENT
A coordinator realigment command has been received.
@ FULL_CAPACITY
PAN at capacity.
@ COUNTER_ERROR
The frame counter of the received frame is invalid.
@ SUCCESS
The operation was completed successfully.
@ UNSUPPORTED_LEGACY
Deprecated security used in IEEE 802.15.4-2003.
@ NO_ACK
No acknowledgment was received after macMaxFrameRetries.
@ SUPERFRAME_OVERLAP
Coordinator superframe and this device superframe tx overlap.
@ UNAVAILABLE_KEY
Unavailable key, unknown or blacklisted.
@ UNSUPPORTED_SECURITY
The security applied is not supported.
@ NO_DATA
No response data were available following a request.
@ INVALID_INDEX
A MAC PIB write failed because specified index is out of range.
@ INVALID_PARAMETER
Primitive parameter not supported or out of range.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
IEEE802.15.4-2011 PHY PIB Attributes Table 52 in section 6.4.2.
Mac16Address macShortAddress
The 16 bit mac short address.
uint16_t macPanId
The identifier of the PAN.
uint8_t macBeaconPayloadLength
The length in octets of the beacon payload.
uint8_t pCurrentChannel
The current logical channel in used in the PHY.
Mac64Address macExtendedAddress
The EUI-64 bit address.
Ptr< Packet > macBeaconPayload
The contents of the beacon payload.
uint8_t pCurrentPage
The current logical page in use in the PHY.
MCPS-DATA.confirm params.
MacStatus m_status
The status of the last MSDU transmission.
uint8_t m_msduHandle
MSDU handle.
MCPS-DATA.indication params.
uint8_t m_mpduLinkQuality
LQI value measured during reception of the MPDU.
uint16_t m_dstPanId
Destination PAN identifier.
uint8_t m_dsn
The DSN of the received data frame.
Mac16Address m_srcAddr
Source address.
Mac64Address m_dstExtAddr
Destination extended address.
Mac64Address m_srcExtAddr
Source extended address.
Mac16Address m_dstAddr
Destination address.
uint8_t m_dstAddrMode
Destination address mode.
uint16_t m_srcPanId
Source PAN identifier.
uint8_t m_srcAddrMode
Source address mode.
MCPS-DATA.request params.
AddressMode m_dstAddrMode
Destination address mode.
Mac16Address m_dstAddr
Destination address.
Mac64Address m_dstExtAddr
Destination extended address.
uint16_t m_dstPanId
Destination PAN identifier.
AddressMode m_srcAddrMode
Source address mode.
uint8_t m_txOptions
Tx Options (bitfield)
uint8_t m_msduHandle
MSDU handle.
MLME-ASSOCIATE.confirm params.
Mac16Address m_assocShortAddr
The short address used in the association request.
MacStatus m_status
The status of a MLME-associate.request.
MLME-ASSOCIATE.indication params.
uint8_t lqi
The link quality indicator of the received associate request command (Not officially supported in the...
Mac64Address m_extDevAddr
The extended address of the device requesting association.
uint8_t capabilityInfo
The operational capabilities of the device requesting association.
MLME-ASSOCIATE.request params.
Mac64Address m_coordExtAddr
The extended address of the coordinator with which to associate.
uint8_t m_coordAddrMode
The coordinator addressing mode for this primitive and subsequent MPDU.
uint8_t m_capabilityInfo
Specifies the operational capabilities of the associating device (bitmap).
Mac16Address m_coordShortAddr
The short address of the coordinator with which to associate.
uint8_t m_chNum
The channel number on which to attempt association.
uint32_t m_chPage
The channel page on which to attempt association.
uint16_t m_coordPanId
The identifier of the PAN with which to associate.
MLME-ASSOCIATE.response params.
Mac16Address m_assocShortAddr
The short address allocated by the coordinator on successful assoc.
MacStatus m_status
The status of the association attempt (As defined on Table 83 IEEE 802.15.4-2006)
Mac64Address m_extDevAddr
The extended address of the device requesting association.
MLME-BEACON-NOTIFY.indication params.
PanDescriptor m_panDescriptor
The PAN descriptor for the received beacon.
uint32_t m_sduLength
The number of octets contained in the beacon payload.
uint8_t m_bsn
The beacon sequence number.
Ptr< Packet > m_sdu
The set of octets comprising the beacon payload.
MLME-COMM-STATUS.indication params.
uint8_t m_dstAddrMode
The destination addressing mode for this primitive.
uint16_t m_panId
The PAN identifier of the device from which the frame was received or to which the frame was being se...
Mac64Address m_srcExtAddr
The extended address of the entity from which the frame causing the error originated.
MacStatus m_status
The communication status.
Mac16Address m_srcShortAddr
The short address of the entity from which the frame causing the error originated.
Mac16Address m_dstShortAddr
The short address of the device for which the frame was intended.
uint8_t m_srcAddrMode
The source addressing mode for this primitive.
Mac64Address m_dstExtAddr
The extended address of the device for which the frame was intended.
MLME-ORPHAN.indication params.
Mac64Address m_orphanAddr
The address of the orphaned device.
MLME-ORPHAN.response params.
bool m_assocMember
T = allocated with this coord | F = otherwise.
Mac64Address m_orphanAddr
The address of the orphaned device.
Mac16Address m_shortAddr
The short address allocated.
MLME-START.confirm params.
MacStatus m_status
The confirmation status resulting from a MLME-poll.request.
MLME-POLL.request params.
uint16_t m_coorPanId
The PAN id of the coordinator to which the poll is intended.
Mac16Address m_coorShortAddr
Coordinator short address.
AddressMode m_coorAddrMode
The addressing mode of the coordinator to which the pool is intended.
Mac64Address m_coorExtAddr
Coordinator extended address.
MLME-SCAN.confirm params.
std::vector< uint8_t > m_unscannedCh
A list of channels given in the request which were not scanned (Not valid for ED scans).
uint32_t m_chPage
The channel page on which the scan was performed.
std::vector< uint8_t > m_energyDetList
A list of energy measurements, one for each channel searched during ED scan (Not valid for Active,...
MacStatus m_status
The status of the scan request.
std::vector< PanDescriptor > m_panDescList
A list of PAN descriptor, one for each beacon found (Not valid for ED and Orphan scans).
uint8_t m_resultListSize
The number of elements returned in the appropriate result list.
uint8_t m_scanType
Indicates the type of scan performed (ED,ACTIVE,PASSIVE,ORPHAN).
MLME-SCAN.request params.
MlmeScanType m_scanType
Indicates the type of scan performed as described in IEEE 802.15.4-2011 (5.1.2.1).
uint32_t m_scanChannels
The channel numbers to be scanned.
uint8_t m_scanDuration
The factor (0-14) used to calculate the length of time to spend scanning.
uint32_t m_chPage
The channel page on which to perform scan.
MacStatus m_status
The result of the request to write the PIB attribute.
MacPibAttributeIdentifier id
The id of the PIB attribute that was written.
MLME-START.confirm params.
MacStatus m_status
The status of a MLME-start.request.
MLME-START.request params.
bool m_battLifeExt
Flag indicating whether or not the Battery life extension (BLE) features are used.
uint8_t m_logCh
Logical channel on which to start using the new superframe configuration.
uint32_t m_logChPage
Logical channel page on which to start using the new superframe configuration.
bool m_coorRealgn
True if a realignment request command is to be transmitted prior changing the superframe.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
bool m_panCoor
On true this device will become coordinator.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
uint16_t m_PanId
Pan Identifier used by the device.
uint32_t m_startTime
Time at which to begin transmitting beacons (Used by Coordinator not PAN Coordinators).
MLME-SYNC-LOSS.indication params.
uint16_t m_panId
The PAN identifier with which the device lost synchronization or to which it was realigned.
uint8_t m_logCh
The channel number on which the device lost synchronization or to which it was realigned.
MacStatus m_lossReason
The reason for the lost of synchronization.
MLME-SYNC.request params.
uint8_t m_logCh
The channel number on which to attempt coordinator synchronization.
bool m_trackBcn
True if the mlme sync with the next beacon and attempts to track future beacons.
PAN Descriptor, Table 17 IEEE 802.15.4-2011.
uint16_t m_coorPanId
The PAN ID of the coordinator as specified in the received beacon frame.
uint8_t m_logCh
The current channel number occupied by the network.
Time m_timeStamp
Beacon frame reception time.
bool m_gtsPermit
TRUE if the beacon is from the PAN coordinator that is accepting GTS requests.
Mac16Address m_coorShortAddr
The coordinator short address as specified in the coordinator address mode.
uint16_t m_superframeSpec
The superframe specification as specified in the received beacon frame.
AddressMode m_coorAddrMode
The coordinator addressing mode corresponding to the received beacon frame.
uint8_t m_linkQuality
The LQI at which the network beacon was received.
uint8_t m_logChPage
The current channel page occupied by the network.
Mac64Address m_coorExtAddr
The coordinator extended address as specified in the coordinator address mode.