MeshNet
1.0.0
|
Static class, that groups static methods to decode network connection 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 uint16_t | GetFlags (const MeshPacket &packet) |
Gets network connect flags. More... | |
static void | SetFlags (MeshPacket &packet, uint16_t 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 uint8_t | GetAssignedAddr (const MeshPacket &packet) |
Gets address assigned to node which requested connection. More... | |
static void | SetAssignedAddr (MeshPacket &packet, uint8_t address) |
Sets address assigned to node which requested connection. More... | |
static bool | IsRefusedConnection (MeshPacket &packet) |
Checks if connection is refused. More... | |
static NetConRespRefuseReason | GetRefuseReason (MeshPacket &packet) |
Gets refuse reason when connection was refused. More... | |
static void | SetRefuseReason (MeshPacket &packet, NetConRespRefuseReason reason) |
Sets refuse reason when connection was refused. More... | |
static uint16_t | GetReservedTime (const MeshPacket &packet) |
Gets reserved time in DHCP table in minutes. More... | |
static void | SetReservedTime (MeshPacket &packet, uint16_t time) |
Sets reserved time in DHCP table in minutes. 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 IsRefusedConnection() 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 bool | Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint16_t flags, MeshMAC foreignBSSID, uint8_t address, uint16_t time, const char *SSID, uint8_t SSID_length) |
Constructs packet of current type. More... | |
static bool | ConstructRefused (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint16_t flags, MeshMAC foreignBSSID, NetConRespRefuseReason reason) |
Constructs refused connection response 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 | |
NetConRespPD () | |
Static class, that groups static methods to decode network connection response packet.
|
inlineprivate |
|
inlinestatic |
Constructs packet of current type.
[in] | packet | System packet to construct. |
sourceAddr | Source node address. | |
destAddr | Destination node address. | |
flags | Network scan flags. | |
foreignBSSID | BSSID of foreign network, which has to receive this frame. | |
address | Address assigned to node which requested connection. | |
time | Reserved time in DHCP table in minutes. | |
[in] | SSID | SSID of network. |
SSID_length | Length of SSID without null terminator. |
|
inlinestatic |
Constructs refused connection response packet of current type.
[in] | packet | System packet to construct. |
sourceAddr | Source node address. | |
destAddr | Destination node address. | |
flags | Network scan flags. | |
foreignBSSID | BSSID of foreign network, which has to receive this frame. | |
reason | Refuse reason. |
|
inlinestatic |
Gets address assigned to node which requested connection.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets network connect 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 refuse reason when connection was refused.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets reserved time in DHCP table in minutes.
[in] | packet | System packet to decode. |
|
inlinestatic |
Copyies SSID from packet to buffer. The SSID is null terminated here. If IsRefusedConnection() 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 connection is refused.
[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 address assigned to node which requested connection.
[in] | packet | System packet to decode. |
address | Address assigned to node which requested connection. |
|
inlinestatic |
Sets network connect flags.
[in] | packet | System packet to decode. |
flags | Network connect 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 refuse reason when connection was refused.
[in] | packet | System packet to decode. |
reason | Refuse reason to set. |
|
inlinestatic |
Sets reserved time in DHCP table in minutes.
[in] | packet | System packet to decode. |
time | Reserved time in DHCP table in minutes. |
|
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.