Tag used to save various data about a packet, like its Spreading Factor and data about interference. More...
#include "lora-tag.h"
Public Member Functions | |
LoraTag (uint8_t sf=0, uint8_t destroyedBy=0) | |
Create a LoraTag with a given spreading factor and collision. More... | |
virtual | ~LoraTag () |
virtual void | Deserialize (TagBuffer i) |
uint8_t | GetDataRate (void) |
Get the data rate for this packet. More... | |
uint8_t | GetDestroyedBy () const |
Read which Spreading Factor this packet was destroyed by. More... | |
double | GetFrequency (void) |
Get the frequency of the packet. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
uint8_t | GetModcod (void) |
Get the modcod for this packet. More... | |
double | GetReceivePower () const |
Read the power this packet arrived with. More... | |
virtual uint32_t | GetSerializedSize () const |
uint8_t | GetSpreadingFactor () const |
Read which Spreading Factor this packet was transmitted with. More... | |
virtual void | Print (std::ostream &os) const |
virtual void | Serialize (TagBuffer i) const |
void | SetDataRate (uint8_t dataRate) |
Set the data rate for this packet. More... | |
void | SetDestroyedBy (uint8_t sf) |
Set which Spreading Factor this packet was destroyed by. More... | |
void | SetFrequency (double frequency) |
Set the frequency of the packet. More... | |
void | SetModcod (uint8_t modcod) |
Set the modcod for this packet. More... | |
void | SetReceivePower (double receivePower) |
Set the power this packet was received with. More... | |
void | SetSpreadingFactor (uint8_t sf) |
Set which Spreading Factor this packet was transmitted with. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Private Attributes | |
uint8_t | m_dataRate |
The Data Rate that needs to be used to send this. More... | |
uint8_t | m_destroyedBy |
The Spreading Factor that destroyed the packet. More... | |
double | m_frequency |
packet. More... | |
uint8_t | m_modcod |
The Modcod ID used by the packet. More... | |
double | m_receivePower |
The reception power of this packet. More... | |
uint8_t | m_sf |
The Spreading Factor used by the packet. More... | |
Tag used to save various data about a packet, like its Spreading Factor and data about interference.
Definition at line 40 of file lora-tag.h.
ns3::LoraTag::LoraTag | ( | uint8_t | sf = 0 , |
uint8_t | destroyedBy = 0 |
||
) |
Create a LoraTag with a given spreading factor and collision.
sf | The Spreading Factor. |
destroyedBy | The SF this tag's packet was destroyed by. |
Definition at line 48 of file lora-tag.cc.
|
virtual |
Definition at line 58 of file lora-tag.cc.
|
virtual |
Definition at line 82 of file lora-tag.cc.
References m_dataRate, m_destroyedBy, m_frequency, m_modcod, m_receivePower, and m_sf.
uint8_t ns3::LoraTag::GetDataRate | ( | void | ) |
Get the data rate for this packet.
Definition at line 148 of file lora-tag.cc.
References m_dataRate.
Referenced by ns3::LorawanGroundMacGateway::Send(), ns3::LorawanOrbiterMacGateway::Send(), and ns3::LorawanMacGateway::Send().
uint8_t ns3::LoraTag::GetDestroyedBy | ( | ) | const |
Read which Spreading Factor this packet was destroyed by.
Definition at line 106 of file lora-tag.cc.
References m_destroyedBy.
double ns3::LoraTag::GetFrequency | ( | void | ) |
Get the frequency of the packet.
Definition at line 142 of file lora-tag.cc.
References m_frequency.
Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket(), ns3::LorawanGroundMacGateway::Send(), ns3::LorawanOrbiterMacGateway::Send(), and ns3::LorawanMacGateway::Send().
|
virtual |
Definition at line 43 of file lora-tag.cc.
References GetTypeId().
uint8_t ns3::LoraTag::GetModcod | ( | void | ) |
Get the modcod for this packet.
Definition at line 160 of file lora-tag.cc.
References m_modcod.
Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket(), ns3::LorawanGroundMacGateway::Send(), ns3::LorawanOrbiterMacGateway::Send(), and ns3::LorawanMacGateway::Send().
double ns3::LoraTag::GetReceivePower | ( | ) | const |
Read the power this packet arrived with.
Definition at line 112 of file lora-tag.cc.
References m_receivePower.
Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket().
|
virtual |
Definition at line 63 of file lora-tag.cc.
uint8_t ns3::LoraTag::GetSpreadingFactor | ( | ) | const |
Read which Spreading Factor this packet was transmitted with.
Definition at line 100 of file lora-tag.cc.
References m_sf.
Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket().
|
static |
Definition at line 36 of file lora-tag.cc.
Referenced by GetInstanceTypeId().
|
virtual |
Definition at line 93 of file lora-tag.cc.
References m_dataRate, m_destroyedBy, m_modcod, m_receivePower, and m_sf.
|
virtual |
Definition at line 71 of file lora-tag.cc.
References m_dataRate, m_destroyedBy, m_frequency, m_modcod, m_receivePower, and m_sf.
void ns3::LoraTag::SetDataRate | ( | uint8_t | dataRate | ) |
Set the data rate for this packet.
dataRate | The data rate. |
Definition at line 154 of file lora-tag.cc.
References m_dataRate.
Referenced by ns3::LoraNetworkStatus::GetReplyForDevice(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().
void ns3::LoraTag::SetDestroyedBy | ( | uint8_t | sf | ) |
Set which Spreading Factor this packet was destroyed by.
sf | The Spreading Factor. |
Definition at line 118 of file lora-tag.cc.
References m_destroyedBy.
void ns3::LoraTag::SetFrequency | ( | double | frequency | ) |
Set the frequency of the packet.
This value works in two ways:
Definition at line 136 of file lora-tag.cc.
References m_frequency.
Referenced by ns3::LoraNetworkStatus::GetReplyForDevice(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().
void ns3::LoraTag::SetModcod | ( | uint8_t | modcod | ) |
Set the modcod for this packet.
dataRate | The modcod. |
Definition at line 166 of file lora-tag.cc.
References m_modcod.
Referenced by ns3::LoraNetworkStatus::GetReplyForDevice(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().
void ns3::LoraTag::SetReceivePower | ( | double | receivePower | ) |
Set the power this packet was received with.
receivePower | The power, in dBm. |
Definition at line 130 of file lora-tag.cc.
References m_receivePower.
void ns3::LoraTag::SetSpreadingFactor | ( | uint8_t | sf | ) |
Set which Spreading Factor this packet was transmitted with.
sf | The Spreading Factor. |
Definition at line 124 of file lora-tag.cc.
References m_sf.
|
private |
The Data Rate that needs to be used to send this.
Definition at line 152 of file lora-tag.h.
Referenced by Deserialize(), GetDataRate(), Print(), Serialize(), and SetDataRate().
|
private |
The Spreading Factor that destroyed the packet.
Definition at line 150 of file lora-tag.h.
Referenced by Deserialize(), GetDestroyedBy(), Print(), Serialize(), and SetDestroyedBy().
|
private |
packet.
The frequency of this packet
Definition at line 154 of file lora-tag.h.
Referenced by Deserialize(), GetFrequency(), Serialize(), and SetFrequency().
|
private |
The Modcod ID used by the packet.
Definition at line 149 of file lora-tag.h.
Referenced by Deserialize(), GetModcod(), Print(), Serialize(), and SetModcod().
|
private |
The reception power of this packet.
Definition at line 151 of file lora-tag.h.
Referenced by Deserialize(), GetReceivePower(), Print(), Serialize(), and SetReceivePower().
|
private |
The Spreading Factor used by the packet.
Definition at line 148 of file lora-tag.h.
Referenced by Deserialize(), GetSpreadingFactor(), Print(), Serialize(), and SetSpreadingFactor().