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 |
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 85 of file lora-end-device-status.h.
typedef std::map<Address, PacketInfoPerGw> ns3::LoraEndDeviceStatus::GatewayList |
Definition at line 165 of file lora-end-device-status.h.
typedef std::list<std::pair<Ptr<const Packet>, ReceivedPacketInfo> > ns3::LoraEndDeviceStatus::ReceivedPacketList |
Definition at line 179 of file lora-end-device-status.h.
ns3::LoraEndDeviceStatus::LoraEndDeviceStatus | ( | ) |
Definition at line 63 of file lora-end-device-status.cc.
References m_receivedPacketList, and m_reply.
ns3::LoraEndDeviceStatus::LoraEndDeviceStatus | ( | LoraDeviceAddress | endDeviceAddress, |
Ptr< LorawanMacEndDeviceClassA > | endDeviceMac | ||
) |
Definition at line 53 of file lora-end-device-status.cc.
|
virtual |
Definition at line 72 of file lora-end-device-status.cc.
void ns3::LoraEndDeviceStatus::AddMACCommand | ( | Ptr< LorawanMacCommand > | macCommand | ) |
Add MAC command to the list.
Definition at line 402 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 89 of file lora-end-device-status.cc.
References m_beamId.
Ptr< Packet > ns3::LoraEndDeviceStatus::GetCompleteReplyPacket | ( | void | ) |
Get the reply packet.
Definition at line 127 of file lora-end-device-status.cc.
References ns3::LoraEndDeviceStatus::Reply::frameHeader, ns3::LoraFrameHeader::GetFCnt(), GetLastPacketReceivedFromDevice(), GetLastReceivedPacketInfo(), m_endDeviceAddress, m_reply, ns3::LoraEndDeviceStatus::Reply::macHeader, ns3::LoraEndDeviceStatus::Reply::payload, 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 104 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 96 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 379 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 364 of file lora-end-device-status.cc.
References m_receivedPacketList.
Referenced by GetCompleteReplyPacket().
Ptr< LorawanMacEndDeviceClassA > ns3::LoraEndDeviceStatus::GetMac | ( | void | ) |
Definition at line 194 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 82 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 426 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 200 of file lora-end-device-status.cc.
References m_receivedPacketList.
LoraFrameHeader ns3::LoraEndDeviceStatus::GetReplyFrameHeader | ( | void | ) |
Get the reply packet frame header.
Definition at line 180 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 173 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 187 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 120 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 112 of file lora-end-device-status.cc.
References m_secondReceiveWindowOffset.
|
static |
Definition at line 45 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 408 of file lora-end-device-status.cc.
References m_receiveWindowEvent.
void ns3::LoraEndDeviceStatus::InitializeReply | ( | void | ) |
Initialize reply.
Definition at line 394 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 274 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 165 of file lora-end-device-status.cc.
References m_reply, and ns3::LoraEndDeviceStatus::Reply::needsReply.
void ns3::LoraEndDeviceStatus::RemoveReceiveWindowOpportunity | ( | void | ) |
Definition at line 420 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 214 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 228 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 221 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 207 of file lora-end-device-status.cc.
References m_modcod.
Referenced by InsertReceivedPacket().
void ns3::LoraEndDeviceStatus::SetReceiveWindowOpportunity | ( | EventId | event | ) |
Definition at line 414 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 256 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 249 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 263 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 242 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 235 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 446 of file lora-end-device-status.cc.
|
private |
Definition at line 344 of file lora-end-device-status.h.
Referenced by GetBeamId(), and SetBeamId().
LoraDeviceAddress ns3::LoraEndDeviceStatus::m_endDeviceAddress |
Definition at line 337 of file lora-end-device-status.h.
Referenced by GetCompleteReplyPacket().
|
private |
Definition at line 346 of file lora-end-device-status.h.
Referenced by GetFirstReceiveWindowFrequency(), and SetFirstReceiveWindowFrequency().
|
private |
Definition at line 345 of file lora-end-device-status.h.
Referenced by GetFirstReceiveWindowSpreadingFactor(), and SetFirstReceiveWindowSpreadingFactor().
|
private |
Pointer to the MAC layer of this device.
Definition at line 355 of file lora-end-device-status.h.
Referenced by GetMac().
|
private |
Definition at line 343 of file lora-end-device-status.h.
Referenced by GetModcod(), and SetModcod().
|
private |
Definition at line 351 of file lora-end-device-status.h.
Referenced by LoraEndDeviceStatus(), GetLastPacketReceivedFromDevice(), GetLastReceivedPacketInfo(), GetPowerGatewayMap(), GetReceivedPacketList(), and InsertReceivedPacket().
|
private |
Definition at line 349 of file lora-end-device-status.h.
Referenced by HasReceiveWindowOpportunityScheduled(), RemoveReceiveWindowOpportunity(), and SetReceiveWindowOpportunity().
struct Reply ns3::LoraEndDeviceStatus::m_reply |
Definition at line 333 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 348 of file lora-end-device-status.h.
Referenced by GetSecondReceiveWindowFrequency(), and SetSecondReceiveWindowFrequency().
|
private |
Definition at line 347 of file lora-end-device-status.h.
Referenced by GetSecondReceiveWindowOffset(), and SetSecondReceiveWindowOffset().