MeshNet
1.0.0
|
Static class, that groups static methods to decode network scan response 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 MeshNodeDescFlags | GetFlags (const MeshPacket &packet) |
Gets network scan response flags. More... | |
static void | SetFlags (MeshPacket &packet, MeshNodeDescFlags flags) |
Sets network scan 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 uint8_t | GetHopsToGateway (const MeshPacket &packet) |
Gets hop count of node to its gateway connection. More... | |
static bool | IsDisconnectedNode (const MeshPacket &packet) |
Checks if node is connected to any network or not. If this returns true, the BSSID of network which is it connected to is contained in packet header. MeshPacketHeader does not contains BSSID field, that's why you have to get it from MeshPacketBuilder after building packet. More... | |
static void | SetHopsToGateway (MeshPacket &packet, uint8_t hops) |
Sets hop count of node to its gateway connection. More... | |
static char * | GetSSIDPtr (const MeshPacket &packet) |
Gets pointer to network SSID. The SSID is not null terminated, that's why you have to check itslength using GetSSIDLength(). If IsDisconnectedNode() method returns true, packet does not contain SSID. More... | |
static bool | GetSSID (const MeshPacket &packet, char *SSID, uint8_t &SSID_length) |
Copyies SSID from packet to buffer. The SSID is null terminated here. If IsDisconnectedNode() method returns true, packet does not contain SSID. More... | |
static uint16_t | GetSSIDLength (const MeshPacket &packet) |
Gets length of SSID. More... | |
static bool | SetSSID (MeshPacket &packet, const char *SSID, uint8_t SSID_length, bool resize=true) |
Sets SSID of network to packet. More... | |
static MeshNetScanResult | GetResult (const MeshPacket &packet, MeshMAC BSSID) |
Converts data from packet to MeshNetScanResult. More... | |
static bool | Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshVersion version, MeshNodeDescFlags flags, MeshMAC foreignBSSID, uint8_t hops, const char *SSID, uint8_t SSID_length) |
Constructs packet of current type. Use this method when node is connected to some network. More... | |
static bool | Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshVersion version, MeshNodeDescFlags flags, MeshMAC foreignBSSID, uint8_t hops) |
Constructs packet of current type. Use this method when node is not connected to any network. More... | |
static bool | Construct (MeshPacket &packet, uint8_t destAddr, const MeshNetScanResult &result, MeshMAC foreignBSSID) |
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 | |
NetScanRespPD () | |
Static class, that groups static methods to decode network scan response packet.
|
inlineprivate |
|
inlinestatic |
Constructs packet of current type.
[in] | packet | System packet to construct. |
destAddr | Destination node address. | |
foreignBSSID | BSSID of foreign network, which has to receive this frame. | |
[in] | result | MeshNetScanResult, which contains almost all scan result info. It is used to set Source address, Version, Flags, HopsToGateway and SSID if set. If no SSID is available, set SSID_ptr to NULL and SSID_length to 0. |
|
inlinestatic |
Constructs packet of current type. Use this method when node is not connected to any network.
[in] | packet | System packet to construct. |
sourceAddr | Source node address. | |
destAddr | Destination node address. | |
version | Version of used MeshNet. | |
flags | Network scan response flags. | |
foreignBSSID | BSSID of foreign network, which has to receive this frame. | |
hops | Hop count of node to its gateway connection or 0 when node is gateway or 255 when node is not connected to any network. |
|
inlinestatic |
Constructs packet of current type. Use this method when node is connected to some network.
[in] | packet | System packet to construct. |
sourceAddr | Source node address. | |
destAddr | Destination node address. | |
version | Version of used MeshNet. | |
flags | Network scan response flags. | |
foreignBSSID | BSSID of foreign network, which has to receive this frame. | |
hops | Hop count of node to its gateway connection or 0 when node is gateway or 255 when node is not connected to any network. | |
[in] | SSID | SSID of network. |
SSID_length | Length of SSID without null terminator. |
|
inlinestatic |
Gets network scan response flags.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets BSSID of foreign network, which has to receive this frame.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking in MeshPacketBuilder.
[in] | frameData | Pointer to data contained in first frame (excluding fields reserved for packet header). |
|
inlinestatic |
Gets hop count of node to its gateway connection.
[in] | packet | System packet to decode. |
|
inlinestatic |
|
inlinestatic |
Converts data from packet to MeshNetScanResult.
[in] | packet | Packet to convert. |
BSSID | BSSID of network, from which response was received. Has to be set manually, because packet header does not contains it. |
|
inlinestatic |
Copyies SSID from packet to buffer. The SSID is null terminated here. If IsDisconnectedNode() method returns true, packet does not contain SSID.
[in] | packet | System packet to decode. |
[out] | SSID | Buffer, where SSID will be copyied. Buffer has to have minimum size GetSSIDLength()+1 bytes. |
[in,out] | SSID_length | Input size(including null terminator) of buffer first, after calling this method it contains length of SSID without null terminator. |
|
inlinestatic |
Gets length of SSID.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets pointer to network SSID. The SSID is not null terminated, that's why you have to check itslength using GetSSIDLength(). If IsDisconnectedNode() method returns true, packet does not contain SSID.
[in] | packet | System packet to decode. |
|
inlinestatic |
Checks if node is connected to any network or not. If this returns true, the BSSID of network which is it connected to is contained in packet header. MeshPacketHeader does not contains BSSID field, that's why you have to get it from MeshPacketBuilder after building packet.
[in] | packet | System packet to decode. |
|
inlinestatic |
Checks if system packet type match decoder type, but does not check its validity.
[in] | packet | System packet to decode. |
|
inlinestatic |
Checks if packet is valid.
[in] | packet | System packet to decode. |
|
inlinestatic |
Checks if packet is valid. Designed for packet header checking in MeshPacketBuilder.
[in] | packetHeader | Received packet header. |
[in] | frameData | Pointer to data contained in first frame (excluding fields reserved for packet header). |
[in] | frameDataSize | Size of frame data in bytes. |
|
inlinestatic |
Sets network scan flags.
[in] | packet | System packet to decode. |
flags | Network scan response flags. |
|
inlinestatic |
Sets BSSID of foreign network, which has to receive this frame.
[in] | packet | System packet to decode. |
foreignBSSID | BSSID of foreign network, which has to receive this frame. |
|
inlinestatic |
Sets hop count of node to its gateway connection.
[in] | packet | System packet to decode. |
hops | Hop count of node to its gateway connection or 0 when node is gateway or 255 when node is not connected to any network. |
|
inlinestatic |
|
inlinestatic |
Sets SSID of network to packet.
[in] | SSID | SSID of network to set. |
SSID_length | Length of SSID without terminator. | |
resize | Set to true to automatically resize packet payload to fit SSID. It is recommended to set it to true. Advanced: Set to false if packet payload can already fit SSID without resizing. |
|
static |
Type of system packet, that can be decoded with current decoder.