MeshNet  1.0.0
Static Public Member Functions | Static Public Attributes | Private Member Functions
NetConRequestPD Class Reference

Static class, that groups static methods to decode network connection request packet. More...

#include <meshPacketDecoders.h>

Static Public Member Functions

static bool IsSameType (const MeshPacket &packet)
 Checks if system packet type match decoder type, but does not check its validity. More...
 
static bool IsValid (const MeshPacket &packet)
 Checks if packet is valid. More...
 
static bool IsValid (const MeshPacketHeader &packetHeader, const uint8_t *frameData, uint8_t frameDataSize)
 Checks if packet is valid. Designed for packet header checking in MeshPacketBuilder. More...
 
static MeshNodeDescFlags GetFlags (const MeshPacket &packet)
 Gets network connect flags. More...
 
static void SetFlags (MeshPacket &packet, MeshNodeDescFlags flags)
 Sets network connect flags. More...
 
static MeshMAC GetForeignNetBSSID (const MeshPacket &packet)
 Gets BSSID of foreign network, which has to receive this frame. More...
 
static MeshMAC GetForeignNetBSSID (const uint8_t *frameData)
 Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking in MeshPacketBuilder. More...
 
static void SetForeignNetBSSID (MeshPacket &packet, MeshMAC foreignBSSID)
 Sets BSSID of foreign network, which has to receive this frame. More...
 
static MeshVersion GetNetVersion (const MeshPacket &packet)
 Gets version of used MeshNet. More...
 
static void SetNetVersion (MeshPacket &packet, MeshVersion version)
 Sets version of used MeshNet. More...
 
static bool Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshNodeDescFlags flags, MeshMAC foreignBSSID, MeshVersion version)
 Constructs packet of current type. More...
 

Static Public Attributes

const static SystemPacketType Type = SPT_Connect
 Type of system packet, that can be decoded with current decoder. More...
 

Private Member Functions

 NetConRequestPD ()
 

Detailed Description

Static class, that groups static methods to decode network connection request packet.

Constructor & Destructor Documentation

◆ NetConRequestPD()

NetConRequestPD::NetConRequestPD ( )
inlineprivate

Member Function Documentation

◆ Construct()

static bool NetConRequestPD::Construct ( MeshPacket packet,
uint8_t  sourceAddr,
uint8_t  destAddr,
MeshNodeDescFlags  flags,
MeshMAC  foreignBSSID,
MeshVersion  version 
)
inlinestatic

Constructs packet of current type.

Parameters
[in]packetSystem packet to construct.
sourceAddrSource node address.
destAddrDestination node address.
flagsNetwork scan flags.
foreignBSSIDBSSID of foreign network, which has to receive this frame.
versionVersion of used MeshNet.
Returns
Returns true when packet was constructed successfully.

◆ GetFlags()

static MeshNodeDescFlags NetConRequestPD::GetFlags ( const MeshPacket packet)
inlinestatic

Gets network connect flags.

Parameters
[in]packetSystem packet to decode.
Returns
Network connect flags.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

◆ GetForeignNetBSSID() [1/2]

static MeshMAC NetConRequestPD::GetForeignNetBSSID ( const MeshPacket packet)
inlinestatic

Gets BSSID of foreign network, which has to receive this frame.

Parameters
[in]packetSystem packet to decode.
Returns
BSSID of foreign network, which has to receive this frame.
Warning
Always check, if packet is valid using IsValid() method and if IsForeignNet() returns true, else exception can be thrown.

◆ GetForeignNetBSSID() [2/2]

static MeshMAC NetConRequestPD::GetForeignNetBSSID ( const uint8_t *  frameData)
inlinestatic

Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking in MeshPacketBuilder.

Parameters
[in]frameDataPointer to data contained in first frame (excluding fields reserved for packet header).
Returns
BSSID of foreign network, which has to receive this frame.
Warning
Always check, if packet is valid using IsValid() method and if IsForeignNet() returns true, else exception can be thrown.

◆ GetNetVersion()

static MeshVersion NetConRequestPD::GetNetVersion ( const MeshPacket packet)
inlinestatic

Gets version of used MeshNet.

Parameters
[in]packetSystem packet to decode.
Returns
Version of MeshNet.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

◆ IsSameType()

static bool NetConRequestPD::IsSameType ( const MeshPacket packet)
inlinestatic

Checks if system packet type match decoder type, but does not check its validity.

Parameters
[in]packetSystem packet to decode.
Returns
True when this decoder should be used to decode current system packet.

◆ IsValid() [1/2]

static bool NetConRequestPD::IsValid ( const MeshPacket packet)
inlinestatic

Checks if packet is valid.

Parameters
[in]packetSystem packet to decode.
Returns
True when packet is valid and can be decoded.
Warning
Invalid packet should not be decoded, because it can cause exception.

◆ IsValid() [2/2]

static bool NetConRequestPD::IsValid ( const MeshPacketHeader packetHeader,
const uint8_t *  frameData,
uint8_t  frameDataSize 
)
inlinestatic

Checks if packet is valid. Designed for packet header checking in MeshPacketBuilder.

Parameters
[in]packetHeaderReceived packet header.
[in]frameDataPointer to data contained in first frame (excluding fields reserved for packet header).
[in]frameDataSizeSize of frame data in bytes.
Returns
True when packet is valid and can be decoded.
Warning
Invalid packet should not be decoded, because it can cause exception.

◆ SetFlags()

static void NetConRequestPD::SetFlags ( MeshPacket packet,
MeshNodeDescFlags  flags 
)
inlinestatic

Sets network connect flags.

Parameters
[in]packetSystem packet to decode.
flagsNetwork connect flags.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

◆ SetForeignNetBSSID()

static void NetConRequestPD::SetForeignNetBSSID ( MeshPacket packet,
MeshMAC  foreignBSSID 
)
inlinestatic

Sets BSSID of foreign network, which has to receive this frame.

Parameters
[in]packetSystem packet to decode.
foreignBSSIDBSSID of foreign network, which has to receive this frame.
Warning
Always check, if packet is valid using IsValid() method and if IsForeignNet() returns true, else exception can be thrown.

◆ SetNetVersion()

static void NetConRequestPD::SetNetVersion ( MeshPacket packet,
MeshVersion  version 
)
inlinestatic

Sets version of used MeshNet.

Parameters
[in]packetSystem packet to decode.
versionVersion of MeshNet.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

Field Documentation

◆ Type

const static SystemPacketType NetConRequestPD::Type = SPT_Connect
static

Type of system packet, that can be decoded with current decoder.


The documentation for this class was generated from the following file: