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

Static class, that groups static methods to decode network scan 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 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 MeshNetScanFlags GetFlags (const MeshPacket &packet)
 Gets network scan flags. More...
 
static MeshNetScanFlags GetFlags (const uint8_t *frameData)
 Gets network scan flags. More...
 
static void SetFlags (MeshPacket &packet, MeshNetScanFlags flags)
 Sets network scan flags. More...
 
static bool HasResponder (const MeshPacket &packet)
 Checks if frame has specified responder. If responder BSSID is specified, only nodes with that BSSID has to respond. More...
 
static bool HasResponder (uint8_t frameDataSize)
 Checks if frame has specified responder. If responder BSSID is specified, only nodes with that BSSID has to respond. More...
 
static MeshMAC GetResponder (const MeshPacket &packet)
 Gets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods and check flag called ResponderIsMAC. Only nodes with matching BSSID or MAC can respond. More...
 
static MeshMAC GetResponder (const uint8_t *frameData)
 Gets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods and check flag called ResponderIsMAC. Only nodes with matching BSSID or MAC can respond. More...
 
static void SetResponder (MeshPacket &packet, MeshMAC responder)
 Sets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods and check flag called ResponderIsMAC. Only nodes with matching BSSID or MAC can respond. More...
 
static bool Construct (MeshPacket &packet, uint8_t sourceAddr, MeshVersion version, MeshNetScanFlags flags)
 Constructs packet of current type. More...
 
static bool Construct (MeshPacket &packet, uint8_t sourceAddr, MeshVersion version, MeshNetScanFlags flags, MeshMAC responder)
 Constructs packet of current type. More...
 

Static Public Attributes

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

Private Member Functions

 NetScanRequestPD ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ NetScanRequestPD()

NetScanRequestPD::NetScanRequestPD ( )
inlineprivate

Member Function Documentation

◆ Construct() [1/2]

static bool NetScanRequestPD::Construct ( MeshPacket packet,
uint8_t  sourceAddr,
MeshVersion  version,
MeshNetScanFlags  flags 
)
inlinestatic

Constructs packet of current type.

Parameters
sourceAddrSource node address.
[in]packetSystem packet to construct.
versionVersion of used MeshNet.
flagsNetwork scan flags.
Returns
Returns true when packet was constructed successfully.

◆ Construct() [2/2]

static bool NetScanRequestPD::Construct ( MeshPacket packet,
uint8_t  sourceAddr,
MeshVersion  version,
MeshNetScanFlags  flags,
MeshMAC  responder 
)
inlinestatic

Constructs packet of current type.

Parameters
sourceAddrSource node address.
[in]packetSystem packet to construct.
versionVersion of used MeshNet.
flagsNetwork scan flags.
responderBSSID of network which nodes has to respond or MAC address of node which has to respond.
Returns
Returns true when packet was constructed successfully.

◆ GetFlags() [1/2]

static MeshNetScanFlags NetScanRequestPD::GetFlags ( const MeshPacket packet)
inlinestatic

Gets network scan flags.

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

◆ GetFlags() [2/2]

static MeshNetScanFlags NetScanRequestPD::GetFlags ( const uint8_t *  frameData)
inlinestatic

Gets network scan flags.

Parameters
[in]frameDataPointer to data contained in first frame (excluding fields reserved for packet header).
Returns
Network scan flags.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

◆ GetNetVersion()

static MeshVersion NetScanRequestPD::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.

◆ GetResponder() [1/2]

static MeshMAC NetScanRequestPD::GetResponder ( const MeshPacket packet)
inlinestatic

Gets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods and check flag called ResponderIsMAC. Only nodes with matching BSSID or MAC can respond.

Parameters
[in]packetSystem packet to decode.
Returns
Responder BSSID of network which nodes has to respond or MAC address of node which has to respond.
Warning
Always check, if packet is valid using IsValid() method and if HasResponder() returns true, else exception can be thrown.

◆ GetResponder() [2/2]

static MeshMAC NetScanRequestPD::GetResponder ( const uint8_t *  frameData)
inlinestatic

Gets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods and check flag called ResponderIsMAC. Only nodes with matching BSSID or MAC can respond.

Parameters
[in]frameDataPointer to data contained in first frame (excluding fields reserved for packet header).
Returns
Responder BSSID of network which nodes has to respond or MAC address of node which has to respond.
Warning
Always check, if packet is valid using IsValid() method and if HasResponder() returns true, else exception can be thrown.

◆ HasResponder() [1/2]

static bool NetScanRequestPD::HasResponder ( const MeshPacket packet)
inlinestatic

Checks if frame has specified responder. If responder BSSID is specified, only nodes with that BSSID has to respond.

◆ HasResponder() [2/2]

static bool NetScanRequestPD::HasResponder ( uint8_t  frameDataSize)
inlinestatic

Checks if frame has specified responder. If responder BSSID is specified, only nodes with that BSSID has to respond.

◆ IsSameType()

static bool NetScanRequestPD::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 NetScanRequestPD::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 NetScanRequestPD::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 NetScanRequestPD::SetFlags ( MeshPacket packet,
MeshNetScanFlags  flags 
)
inlinestatic

Sets network scan flags.

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

◆ SetNetVersion()

static void NetScanRequestPD::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.

◆ SetResponder()

static void NetScanRequestPD::SetResponder ( MeshPacket packet,
MeshMAC  responder 
)
inlinestatic

Sets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods and check flag called ResponderIsMAC. Only nodes with matching BSSID or MAC can respond.

Parameters
[in]packetSystem packet to decode.
responderBSSID of network which nodes has to respond or MAC address of node which has to respond.
Warning
Always check, if packet is valid using IsValid() method and if HasResponder() returns true, else exception can be thrown.

Field Documentation

◆ Type

const static SystemPacketType NetScanRequestPD::Type = SPT_NetScan
static

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


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