This class represents the Network Server's knowledge about an End Device in the LoRaWAN network it is administering. More...
#include "lora-end-device-status.h"
Classes | |
struct | PacketInfoPerGw |
Structure saving information regarding the packet reception in each gateway. More... | |
struct | ReceivedPacketInfo |
Structure saving information regarding all packet receptions. More... | |
struct | Reply |
Structure representing the reply that the network server will send this device at the first opportunity. More... | |
Public Types | |
typedef std::map< Address, PacketInfoPerGw > | GatewayList |
typedef std::list< std::pair< Ptr< const Packet >, ReceivedPacketInfo > > | ReceivedPacketList |
Public Member Functions | |
LoraEndDeviceStatus () | |
LoraEndDeviceStatus (LoraDeviceAddress endDeviceAddress, Ptr< LorawanMacEndDeviceClassA > endDeviceMac) | |
virtual | ~LoraEndDeviceStatus () |
void | AddMACCommand (Ptr< LorawanMacCommand > macCommand) |
Add MAC command to the list. More... | |
uint8_t | GetBeamId (void) |
Get the beam ID this device is using. More... | |
Ptr< Packet > | GetCompleteReplyPacket (void) |
Get the reply packet. More... | |
double | GetFirstReceiveWindowFrequency (void) |
Get the first window frequency of this device. More... | |
uint8_t | GetFirstReceiveWindowSpreadingFactor (void) |
Get the spreading factor this device is using in the first receive window. More... | |
Ptr< const Packet > | GetLastPacketReceivedFromDevice (void) |
Return the last packet that was received from this device. More... | |
LoraEndDeviceStatus::ReceivedPacketInfo | GetLastReceivedPacketInfo (void) |
Return the information about the last packet that was received from the device. More... | |
Ptr< LorawanMacEndDeviceClassA > | GetMac (void) |
uint8_t | GetModcod (void) |
Get the modcod this device is using. More... | |
std::map< double, Address > | GetPowerGatewayMap (void) |
Return an ordered list of the best gateways. More... | |
ReceivedPacketList | GetReceivedPacketList (void) |
Get the received packet list. More... | |
LoraFrameHeader | GetReplyFrameHeader (void) |
Get the reply packet frame header. More... | |
LorawanMacHeader | GetReplyMacHeader (void) |
Get the reply packet mac header. More... | |
Ptr< Packet > | GetReplyPayload (void) |
Get the data of the reply packet. More... | |
double | GetSecondReceiveWindowFrequency (void) |
Return the second window frequency of this device. More... | |
uint8_t | GetSecondReceiveWindowOffset (void) |
Get the offset of spreading factor this device is using in the second receive window with respect to the first receive window. More... | |
bool | HasReceiveWindowOpportunityScheduled () |
Returns whether we already decided we will schedule a transmission to this ED. More... | |
void | InitializeReply (void) |
Initialize reply. More... | |
void | InsertReceivedPacket (Ptr< const Packet > receivedPacket, const Address &gwAddress) |
Insert a received packet in the packet list. More... | |
bool | NeedsReply (void) |
Whether the end device needs a reply. More... | |
void | RemoveReceiveWindowOpportunity (void) |
void | SetBeamId (uint8_t beamId) |
Set the beam ID this device is using. More... | |
void | SetFirstReceiveWindowFrequency (double frequency) |
Set the first window frequency of this device. More... | |
void | SetFirstReceiveWindowSpreadingFactor (uint8_t sf) |
Set the spreading factor this device is using in the first receive window. More... | |
void | SetModcod (uint8_t modcod) |
Set the modcod this device is using. More... | |
void | SetReceiveWindowOpportunity (EventId event) |
void | SetReplyFrameHeader (LoraFrameHeader frameHeader) |
Set the reply packet frame header. More... | |
void | SetReplyMacHeader (LorawanMacHeader macHeader) |
Set the reply packet mac header. More... | |
void | SetReplyPayload (Ptr< Packet > replyPayload) |
Set the packet reply payload. More... | |
void | SetSecondReceiveWindowFrequency (double frequency) |
Set the second window frequency of this device. More... | |
void | SetSecondReceiveWindowOffset (uint8_t offset) |
Set the spreading factor this device is using in the first receive window. More... | |
void | UpdateGatewayData (GatewayList gwList, Address gwAddress, double rcvPower) |
Update Gateway data when more then one gateway receive the same packet. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Public Attributes | |
LoraDeviceAddress | m_endDeviceAddress |
struct Reply | m_reply |
Private Attributes | |
uint8_t | m_beamId |
double | m_firstReceiveWindowFrequency = 0 |
uint8_t | m_firstReceiveWindowSpreadingFactor = 0 |
Ptr< LorawanMacEndDeviceClassA > | m_mac |
Pointer to the MAC layer of this device. More... | |
uint8_t | m_modcod |
ReceivedPacketList | m_receivedPacketList |
EventId | m_receiveWindowEvent |
double | m_secondReceiveWindowFrequency = 869.525 |
uint8_t | m_secondReceiveWindowOffset = 0 |
Address | m_utAddress |
Friends | |
std::ostream & | operator<< (std::ostream &os, const LoraEndDeviceStatus &status) |
This class represents the Network Server's knowledge about an End Device in the LoRaWAN network it is administering.
The Network Server's NetworkStatus component contains a list of instances of this class, one for each device in the network. Each instance contains all the parameters and information of the end device and the packets received from it. Furthermore, this class holds the reply packet that the network server will send to this device at the first available receive window. Upon new packet arrivals at the Network Server, the OnReceivedPacket method is called to update the information regarding the last received packet and its parameters.
Definition at line 90 of file lora-end-device-status.h.
typedef std::map<Address, PacketInfoPerGw> ns3::LoraEndDeviceStatus::GatewayList |
Definition at line 170 of file lora-end-device-status.h.
typedef std::list<std::pair<Ptr<const Packet>, ReceivedPacketInfo> > ns3::LoraEndDeviceStatus::ReceivedPacketList |
Definition at line 184 of file lora-end-device-status.h.
ns3::LoraEndDeviceStatus::LoraEndDeviceStatus | ( | ) |
Definition at line 71 of file lora-end-device-status.cc.
References m_receivedPacketList, and m_reply.
ns3::LoraEndDeviceStatus::LoraEndDeviceStatus | ( | LoraDeviceAddress | endDeviceAddress, |
Ptr< LorawanMacEndDeviceClassA > | endDeviceMac | ||
) |
Definition at line 60 of file lora-end-device-status.cc.
|
virtual |
Definition at line 80 of file lora-end-device-status.cc.
void ns3::LoraEndDeviceStatus::AddMACCommand | ( | Ptr< LorawanMacCommand > | macCommand | ) |
Add MAC command to the list.
Definition at line 419 of file lora-end-device-status.cc.
References ns3::LoraFrameHeader::AddCommand(), ns3::LoraEndDeviceStatus::Reply::frameHeader, and m_reply.
uint8_t ns3::LoraEndDeviceStatus::GetBeamId | ( | void | ) |
Get the beam ID this device is using.
Definition at line 97 of file lora-end-device-status.cc.
References m_beamId.
Ptr< Packet > ns3::LoraEndDeviceStatus::GetCompleteReplyPacket | ( | void | ) |
Get the reply packet.
Definition at line 135 of file lora-end-device-status.cc.
References ns3::LoraEndDeviceStatus::Reply::frameHeader, ns3::LoraFrameHeader::GetFCnt(), GetLastPacketReceivedFromDevice(), GetLastReceivedPacketInfo(), m_endDeviceAddress, m_reply, m_utAddress, ns3::LoraEndDeviceStatus::Reply::macHeader, ns3::LoraEndDeviceStatus::Reply::payload, ns3::SatEnums::REGENERATION_NETWORK, ns3::LoraFrameHeader::SetAddress(), ns3::LoraFrameHeader::SetAsUplink(), ns3::LoraFrameHeader::SetFCnt(), ns3::LorawanMacHeader::SetMType(), and ns3::LorawanMacHeader::UNCONFIRMED_DATA_DOWN.
double ns3::LoraEndDeviceStatus::GetFirstReceiveWindowFrequency | ( | void | ) |
Get the first window frequency of this device.
Definition at line 112 of file lora-end-device-status.cc.
References m_firstReceiveWindowFrequency.
uint8_t ns3::LoraEndDeviceStatus::GetFirstReceiveWindowSpreadingFactor | ( | void | ) |
Get the spreading factor this device is using in the first receive window.
Definition at line 104 of file lora-end-device-status.cc.
References m_firstReceiveWindowSpreadingFactor.
Ptr< const Packet > ns3::LoraEndDeviceStatus::GetLastPacketReceivedFromDevice | ( | void | ) |
Return the last packet that was received from this device.
Definition at line 396 of file lora-end-device-status.cc.
References m_receivedPacketList.
Referenced by GetCompleteReplyPacket().
LoraEndDeviceStatus::ReceivedPacketInfo ns3::LoraEndDeviceStatus::GetLastReceivedPacketInfo | ( | void | ) |
Return the information about the last packet that was received from the device.
Definition at line 381 of file lora-end-device-status.cc.
References m_receivedPacketList.
Referenced by GetCompleteReplyPacket().
Ptr< LorawanMacEndDeviceClassA > ns3::LoraEndDeviceStatus::GetMac | ( | void | ) |
Definition at line 210 of file lora-end-device-status.cc.
References m_mac.
uint8_t ns3::LoraEndDeviceStatus::GetModcod | ( | void | ) |
Get the modcod this device is using.
Definition at line 90 of file lora-end-device-status.cc.
References m_modcod.
std::map< double, Address > ns3::LoraEndDeviceStatus::GetPowerGatewayMap | ( | void | ) |
Return an ordered list of the best gateways.
Definition at line 443 of file lora-end-device-status.cc.
References ns3::LoraEndDeviceStatus::ReceivedPacketInfo::gwList, and m_receivedPacketList.
LoraEndDeviceStatus::ReceivedPacketList ns3::LoraEndDeviceStatus::GetReceivedPacketList | ( | void | ) |
Get the received packet list.
Definition at line 216 of file lora-end-device-status.cc.
References m_receivedPacketList.
LoraFrameHeader ns3::LoraEndDeviceStatus::GetReplyFrameHeader | ( | void | ) |
Get the reply packet frame header.
Definition at line 196 of file lora-end-device-status.cc.
References ns3::LoraEndDeviceStatus::Reply::frameHeader, and m_reply.
LorawanMacHeader ns3::LoraEndDeviceStatus::GetReplyMacHeader | ( | void | ) |
Get the reply packet mac header.
Definition at line 189 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::macHeader.
Ptr< Packet > ns3::LoraEndDeviceStatus::GetReplyPayload | ( | void | ) |
Get the data of the reply packet.
Definition at line 203 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::payload.
double ns3::LoraEndDeviceStatus::GetSecondReceiveWindowFrequency | ( | void | ) |
Return the second window frequency of this device.
Definition at line 128 of file lora-end-device-status.cc.
References m_secondReceiveWindowFrequency.
uint8_t ns3::LoraEndDeviceStatus::GetSecondReceiveWindowOffset | ( | void | ) |
Get the offset of spreading factor this device is using in the second receive window with respect to the first receive window.
Definition at line 120 of file lora-end-device-status.cc.
References m_secondReceiveWindowOffset.
|
static |
Definition at line 52 of file lora-end-device-status.cc.
bool ns3::LoraEndDeviceStatus::HasReceiveWindowOpportunityScheduled | ( | ) |
Returns whether we already decided we will schedule a transmission to this ED.
Definition at line 425 of file lora-end-device-status.cc.
References m_receiveWindowEvent.
void ns3::LoraEndDeviceStatus::InitializeReply | ( | void | ) |
Initialize reply.
Definition at line 411 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::needsReply.
void ns3::LoraEndDeviceStatus::InsertReceivedPacket | ( | Ptr< const Packet > | receivedPacket, |
const Address & | gwAddress | ||
) |
Insert a received packet in the packet list.
Definition at line 291 of file lora-end-device-status.cc.
References ns3::LoraEndDeviceStatus::ReceivedPacketInfo::frequency, ns3::LoraBeamTag::GetBeamId(), ns3::LoraFrameHeader::GetFCnt(), ns3::LoraTag::GetFrequency(), ns3::LoraTag::GetModcod(), ns3::LoraTag::GetReceivePower(), ns3::LoraTag::GetSpreadingFactor(), ns3::LoraEndDeviceStatus::PacketInfoPerGw::gwAddress, ns3::LoraEndDeviceStatus::ReceivedPacketInfo::gwList, m_receivedPacketList, ns3::LoraEndDeviceStatus::ReceivedPacketInfo::packet, ns3::LoraEndDeviceStatus::PacketInfoPerGw::receivedTime, ns3::LoraEndDeviceStatus::PacketInfoPerGw::rxPower, ns3::LoraFrameHeader::SetAsUplink(), SetBeamId(), SetFirstReceiveWindowFrequency(), SetFirstReceiveWindowSpreadingFactor(), SetModcod(), and ns3::LoraEndDeviceStatus::ReceivedPacketInfo::sf.
bool ns3::LoraEndDeviceStatus::NeedsReply | ( | void | ) |
Whether the end device needs a reply.
This is determined by looking at headers and payload of the Reply structure: if they are empty, no reply should be needed.
Definition at line 181 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::needsReply.
void ns3::LoraEndDeviceStatus::RemoveReceiveWindowOpportunity | ( | void | ) |
Definition at line 437 of file lora-end-device-status.cc.
References m_receiveWindowEvent.
void ns3::LoraEndDeviceStatus::SetBeamId | ( | uint8_t | beamId | ) |
Set the beam ID this device is using.
Definition at line 230 of file lora-end-device-status.cc.
References m_beamId.
Referenced by InsertReceivedPacket().
void ns3::LoraEndDeviceStatus::SetFirstReceiveWindowFrequency | ( | double | frequency | ) |
Set the first window frequency of this device.
Definition at line 245 of file lora-end-device-status.cc.
References m_firstReceiveWindowFrequency.
Referenced by InsertReceivedPacket().
void ns3::LoraEndDeviceStatus::SetFirstReceiveWindowSpreadingFactor | ( | uint8_t | sf | ) |
Set the spreading factor this device is using in the first receive window.
Definition at line 238 of file lora-end-device-status.cc.
References m_firstReceiveWindowSpreadingFactor.
Referenced by InsertReceivedPacket().
void ns3::LoraEndDeviceStatus::SetModcod | ( | uint8_t | modcod | ) |
Set the modcod this device is using.
Definition at line 223 of file lora-end-device-status.cc.
References m_modcod.
Referenced by InsertReceivedPacket().
void ns3::LoraEndDeviceStatus::SetReceiveWindowOpportunity | ( | EventId | event | ) |
Definition at line 431 of file lora-end-device-status.cc.
References m_receiveWindowEvent.
void ns3::LoraEndDeviceStatus::SetReplyFrameHeader | ( | LoraFrameHeader | frameHeader | ) |
Set the reply packet frame header.
Definition at line 273 of file lora-end-device-status.cc.
References ns3::LoraEndDeviceStatus::Reply::frameHeader, and m_reply.
void ns3::LoraEndDeviceStatus::SetReplyMacHeader | ( | LorawanMacHeader | macHeader | ) |
Set the reply packet mac header.
Definition at line 266 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::macHeader.
void ns3::LoraEndDeviceStatus::SetReplyPayload | ( | Ptr< Packet > | replyPayload | ) |
Set the packet reply payload.
Definition at line 280 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::payload.
void ns3::LoraEndDeviceStatus::SetSecondReceiveWindowFrequency | ( | double | frequency | ) |
Set the second window frequency of this device.
Definition at line 259 of file lora-end-device-status.cc.
References m_secondReceiveWindowFrequency.
void ns3::LoraEndDeviceStatus::SetSecondReceiveWindowOffset | ( | uint8_t | offset | ) |
Set the spreading factor this device is using in the first receive window.
Definition at line 252 of file lora-end-device-status.cc.
References m_secondReceiveWindowOffset.
void ns3::LoraEndDeviceStatus::UpdateGatewayData | ( | GatewayList | gwList, |
Address | gwAddress, | ||
double | rcvPower | ||
) |
Update Gateway data when more then one gateway receive the same packet.
|
friend |
Definition at line 463 of file lora-end-device-status.cc.
|
private |
Definition at line 349 of file lora-end-device-status.h.
Referenced by GetBeamId(), and SetBeamId().
LoraDeviceAddress ns3::LoraEndDeviceStatus::m_endDeviceAddress |
Definition at line 342 of file lora-end-device-status.h.
Referenced by GetCompleteReplyPacket().
|
private |
Definition at line 352 of file lora-end-device-status.h.
Referenced by GetFirstReceiveWindowFrequency(), and SetFirstReceiveWindowFrequency().
|
private |
Definition at line 351 of file lora-end-device-status.h.
Referenced by GetFirstReceiveWindowSpreadingFactor(), and SetFirstReceiveWindowSpreadingFactor().
|
private |
Pointer to the MAC layer of this device.
Definition at line 361 of file lora-end-device-status.h.
Referenced by GetMac().
|
private |
Definition at line 348 of file lora-end-device-status.h.
Referenced by GetModcod(), and SetModcod().
|
private |
Definition at line 357 of file lora-end-device-status.h.
Referenced by LoraEndDeviceStatus(), GetLastPacketReceivedFromDevice(), GetLastReceivedPacketInfo(), GetPowerGatewayMap(), GetReceivedPacketList(), and InsertReceivedPacket().
|
private |
Definition at line 355 of file lora-end-device-status.h.
Referenced by HasReceiveWindowOpportunityScheduled(), RemoveReceiveWindowOpportunity(), and SetReceiveWindowOpportunity().
struct Reply ns3::LoraEndDeviceStatus::m_reply |
Definition at line 338 of file lora-end-device-status.h.
Referenced by LoraEndDeviceStatus(), AddMACCommand(), GetCompleteReplyPacket(), GetReplyFrameHeader(), GetReplyMacHeader(), GetReplyPayload(), InitializeReply(), NeedsReply(), SetReplyFrameHeader(), SetReplyMacHeader(), and SetReplyPayload().
|
private |
Definition at line 354 of file lora-end-device-status.h.
Referenced by GetSecondReceiveWindowFrequency(), and SetSecondReceiveWindowFrequency().
|
private |
Definition at line 353 of file lora-end-device-status.h.
Referenced by GetSecondReceiveWindowOffset(), and SetSecondReceiveWindowOffset().
|
private |
Definition at line 350 of file lora-end-device-status.h.
Referenced by GetCompleteReplyPacket().