Static class, that groups static methods to decode relayied network connection request packet.
More...
#include <meshPacketDecoders.h>
|
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 | GetRequesterMAC (const MeshPacket &packet) |
| Gets MAC address of node, which requests network connection. More...
|
|
static void | SetRequesterMAC (MeshPacket &packet, MeshMAC requesterMAC) |
| SetsMAC address of node, which requests network connection. 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 requesterMAC, MeshVersion version) |
| Constructs packet of current type. More...
|
|
|
const static SystemPacketType | Type = SPT_Connect |
| Type of system packet, that can be decoded with current decoder. More...
|
|
Static class, that groups static methods to decode relayied network connection request packet.
◆ RelNetConRequestPD()
RelNetConRequestPD::RelNetConRequestPD |
( |
| ) |
|
|
inlineprivate |
◆ Construct()
Constructs packet of current type.
- Parameters
-
[in] | packet | System packet to construct. |
| sourceAddr | Source node address. |
| destAddr | Destination node address. |
| flags | Network scan flags. |
| requesterMAC | MAC address of node, which requests network connection. |
| version | Version of used MeshNet. |
- Returns
- Returns true when packet was constructed successfully.
◆ GetFlags()
Gets network connect flags.
- Parameters
-
[in] | packet | System packet to decode. |
- Returns
- Network connect flags.
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ GetNetVersion()
Gets version of used MeshNet.
- Parameters
-
[in] | packet | System packet to decode. |
- Returns
- Version of MeshNet.
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ GetRequesterMAC()
Gets MAC address of node, which requests network connection.
- Parameters
-
[in] | packet | System packet to decode. |
- Returns
- MAC address of node, which requests network connection.
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ IsSameType()
static bool RelNetConRequestPD::IsSameType |
( |
const MeshPacket & |
packet | ) |
|
|
inlinestatic |
Checks if system packet type match decoder type, but does not check its validity.
- Parameters
-
[in] | packet | System packet to decode. |
- Returns
- True when this decoder should be used to decode current system packet.
◆ IsValid() [1/2]
static bool RelNetConRequestPD::IsValid |
( |
const MeshPacket & |
packet | ) |
|
|
inlinestatic |
Checks if packet is valid.
- Parameters
-
[in] | packet | System 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 RelNetConRequestPD::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] | 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. |
- Returns
- True when packet is valid and can be decoded.
- Warning
- Invalid packet should not be decoded, because it can cause exception.
◆ SetFlags()
Sets network connect flags.
- Parameters
-
[in] | packet | System packet to decode. |
| flags | Network connect flags. |
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ SetNetVersion()
Sets version of used MeshNet.
- Parameters
-
[in] | packet | System packet to decode. |
| version | Version of MeshNet. |
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ SetRequesterMAC()
static void RelNetConRequestPD::SetRequesterMAC |
( |
MeshPacket & |
packet, |
|
|
MeshMAC |
requesterMAC |
|
) |
| |
|
inlinestatic |
SetsMAC address of node, which requests network connection.
- Parameters
-
[in] | packet | System packet to decode. |
| requesterMAC | MAC address of node, which requests network connection. |
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ Type
const static SystemPacketType RelNetConRequestPD::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: