This base class is used to represent a general MAC command. More...
#include "lorawan-mac-command.h"
Public Member Functions | |
LorawanMacCommand () | |
virtual | ~LorawanMacCommand () |
virtual uint8_t | Deserialize (Buffer::Iterator &start)=0 |
Deserialize the buffer into a MAC command. More... | |
virtual enum MacCommandType | GetCommandType (void) const |
Get the commandType of this MAC command. More... | |
virtual uint8_t | GetSerializedSize (void) const |
Get serialized length of this MAC command. More... | |
virtual void | Print (std::ostream &os) const =0 |
Print the contents of this MAC command in human-readable format. More... | |
virtual void | Serialize (Buffer::Iterator &start) const =0 |
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard. More... | |
Static Public Member Functions | |
static uint8_t | GetCIDFromLorawanMacCommand (enum MacCommandType commandType) |
Get the CID that corresponds to this MAC command. More... | |
static TypeId | GetTypeId (void) |
Protected Attributes | |
enum MacCommandType | m_commandType |
The type of this command. More... | |
uint8_t | m_serializedSize |
This MAC command's serialized size. More... | |
This base class is used to represent a general MAC command.
Pure virtual methods that handle serialization, deserialization and other common features are supposed to be defined in detail by child classes, based on that MAC command's attributes and structure.
Definition at line 70 of file lorawan-mac-command.h.
ns3::LorawanMacCommand::LorawanMacCommand | ( | ) |
Definition at line 47 of file lorawan-mac-command.cc.
|
virtual |
Definition at line 52 of file lorawan-mac-command.cc.
|
pure virtual |
Deserialize the buffer into a MAC command.
start | A pointer to the buffer that contains the serialized command. |
Implemented in ns3::DlChannelAns, ns3::TxParamSetupReq, ns3::TxParamSetupAns, ns3::RxTimingSetupAns, ns3::RxTimingSetupReq, ns3::NewChannelAns, ns3::NewChannelReq, ns3::DevStatusAns, ns3::DevStatusReq, ns3::RxParamSetupAns, ns3::RxParamSetupReq, ns3::DutyCycleAns, ns3::DutyCycleReq, ns3::LinkAdrAns, ns3::LinkAdrReq, ns3::LinkCheckAns, and ns3::LinkCheckReq.
|
static |
Get the CID that corresponds to this MAC command.
Definition at line 74 of file lorawan-mac-command.cc.
References ns3::DEV_STATUS_ANS, ns3::DEV_STATUS_REQ, ns3::DL_CHANNEL_ANS, ns3::DL_CHANNEL_REQ, ns3::DUTY_CYCLE_ANS, ns3::DUTY_CYCLE_REQ, ns3::INVALID, ns3::LINK_ADR_ANS, ns3::LINK_ADR_REQ, ns3::LINK_CHECK_ANS, ns3::LINK_CHECK_REQ, ns3::NEW_CHANNEL_ANS, ns3::NEW_CHANNEL_REQ, ns3::RX_PARAM_SETUP_ANS, ns3::RX_PARAM_SETUP_REQ, ns3::RX_TIMING_SETUP_ANS, ns3::RX_TIMING_SETUP_REQ, ns3::TX_PARAM_SETUP_ANS, and ns3::TX_PARAM_SETUP_REQ.
Referenced by ns3::LorawanMacEndDevice::ApplyNecessaryOptions(), ns3::LinkCheckReq::Serialize(), ns3::LinkCheckAns::Serialize(), ns3::LinkAdrReq::Serialize(), ns3::LinkAdrAns::Serialize(), ns3::DutyCycleReq::Serialize(), ns3::DutyCycleAns::Serialize(), ns3::RxParamSetupReq::Serialize(), ns3::RxParamSetupAns::Serialize(), ns3::DevStatusReq::Serialize(), ns3::DevStatusAns::Serialize(), ns3::NewChannelReq::Serialize(), ns3::NewChannelAns::Serialize(), ns3::RxTimingSetupReq::Serialize(), ns3::RxTimingSetupAns::Serialize(), ns3::TxParamSetupAns::Serialize(), ns3::TxParamSetupReq::Serialize(), and ns3::DlChannelAns::Serialize().
|
virtual |
Get the commandType of this MAC command.
Definition at line 52 of file lorawan-mac-command.cc.
|
virtual |
Get serialized length of this MAC command.
Definition at line 66 of file lorawan-mac-command.cc.
References m_serializedSize.
|
static |
Definition at line 41 of file lorawan-mac-command.cc.
|
pure virtual |
Print the contents of this MAC command in human-readable format.
os | The std::ostream instance on which to print the MAC command. |
Implemented in ns3::DlChannelAns, ns3::TxParamSetupReq, ns3::TxParamSetupAns, ns3::RxTimingSetupAns, ns3::RxTimingSetupReq, ns3::NewChannelAns, ns3::NewChannelReq, ns3::DevStatusAns, ns3::DevStatusReq, ns3::RxParamSetupAns, ns3::RxParamSetupReq, ns3::DutyCycleAns, ns3::DutyCycleReq, ns3::LinkAdrAns, ns3::LinkAdrReq, ns3::LinkCheckAns, and ns3::LinkCheckReq.
|
pure virtual |
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
start | A pointer to the buffer into which to serialize the command. |
Implemented in ns3::DlChannelAns, ns3::TxParamSetupReq, ns3::TxParamSetupAns, ns3::RxTimingSetupAns, ns3::RxTimingSetupReq, ns3::NewChannelAns, ns3::NewChannelReq, ns3::DevStatusAns, ns3::DevStatusReq, ns3::RxParamSetupAns, ns3::RxParamSetupReq, ns3::DutyCycleAns, ns3::DutyCycleReq, ns3::LinkAdrAns, ns3::LinkAdrReq, ns3::LinkCheckAns, and ns3::LinkCheckReq.
|
protected |
The type of this command.
Definition at line 120 of file lorawan-mac-command.h.
Referenced by ns3::DevStatusAns::DevStatusAns(), ns3::DevStatusReq::DevStatusReq(), ns3::DlChannelAns::DlChannelAns(), ns3::DutyCycleAns::DutyCycleAns(), ns3::DutyCycleReq::DutyCycleReq(), ns3::LinkAdrAns::LinkAdrAns(), ns3::LinkAdrReq::LinkAdrReq(), ns3::LinkCheckAns::LinkCheckAns(), ns3::LinkCheckReq::LinkCheckReq(), ns3::NewChannelAns::NewChannelAns(), ns3::NewChannelReq::NewChannelReq(), ns3::RxParamSetupAns::RxParamSetupAns(), ns3::RxParamSetupReq::RxParamSetupReq(), ns3::RxTimingSetupAns::RxTimingSetupAns(), ns3::RxTimingSetupReq::RxTimingSetupReq(), ns3::TxParamSetupAns::TxParamSetupAns(), ns3::TxParamSetupReq::TxParamSetupReq(), ns3::LinkCheckReq::Serialize(), ns3::LinkCheckAns::Serialize(), ns3::LinkAdrReq::Serialize(), ns3::LinkAdrAns::Serialize(), ns3::DutyCycleReq::Serialize(), ns3::DutyCycleAns::Serialize(), ns3::RxParamSetupReq::Serialize(), ns3::RxParamSetupAns::Serialize(), ns3::DevStatusReq::Serialize(), ns3::DevStatusAns::Serialize(), ns3::NewChannelReq::Serialize(), ns3::NewChannelAns::Serialize(), ns3::RxTimingSetupReq::Serialize(), ns3::RxTimingSetupAns::Serialize(), ns3::TxParamSetupAns::Serialize(), ns3::TxParamSetupReq::Serialize(), and ns3::DlChannelAns::Serialize().
|
protected |
This MAC command's serialized size.
Definition at line 131 of file lorawan-mac-command.h.
Referenced by ns3::DevStatusAns::DevStatusAns(), ns3::DevStatusReq::DevStatusReq(), ns3::DlChannelAns::DlChannelAns(), ns3::DutyCycleAns::DutyCycleAns(), ns3::DutyCycleReq::DutyCycleReq(), ns3::LinkAdrAns::LinkAdrAns(), ns3::LinkAdrReq::LinkAdrReq(), ns3::LinkCheckAns::LinkCheckAns(), ns3::LinkCheckReq::LinkCheckReq(), ns3::NewChannelAns::NewChannelAns(), ns3::NewChannelReq::NewChannelReq(), ns3::RxParamSetupAns::RxParamSetupAns(), ns3::RxParamSetupReq::RxParamSetupReq(), ns3::RxTimingSetupAns::RxTimingSetupAns(), ns3::RxTimingSetupReq::RxTimingSetupReq(), ns3::TxParamSetupAns::TxParamSetupAns(), ns3::TxParamSetupReq::TxParamSetupReq(), ns3::LinkCheckReq::Deserialize(), ns3::LinkCheckAns::Deserialize(), ns3::LinkAdrReq::Deserialize(), ns3::LinkAdrAns::Deserialize(), ns3::DutyCycleReq::Deserialize(), ns3::DutyCycleAns::Deserialize(), ns3::RxParamSetupReq::Deserialize(), ns3::RxParamSetupAns::Deserialize(), ns3::DevStatusReq::Deserialize(), ns3::DevStatusAns::Deserialize(), ns3::NewChannelReq::Deserialize(), ns3::NewChannelAns::Deserialize(), ns3::RxTimingSetupReq::Deserialize(), ns3::RxTimingSetupAns::Deserialize(), ns3::TxParamSetupAns::Deserialize(), ns3::TxParamSetupReq::Deserialize(), ns3::DlChannelAns::Deserialize(), and GetSerializedSize().