Static class, that groups static methods to decode path discovery response 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 MeshMAC | GetMAC (const MeshPacket &packet) |
| Gets MAC address of node, which evoked packet discovery. More...
|
|
static void | SetMAC (MeshPacket &packet, MeshMAC MAC) |
| Sets MAC address of node, which evoked packet discovery. More...
|
|
static uint8_t | GetReqID (const MeshPacket &packet) |
| Gets ID of path discovery packet, this response belongs to. More...
|
|
static void | SetReqID (MeshPacket &packet, uint8_t ReqID) |
| Sets ID of path discovery packet, this response belongs to. More...
|
|
static bool | Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshMAC MAC, uint8_t ReqID) |
| Constructs packet of current type. More...
|
|
Static class, that groups static methods to decode path discovery response packet.
◆ PathDiscRespPD()
PathDiscRespPD::PathDiscRespPD |
( |
| ) |
|
|
inlineprivate |
◆ Construct()
static bool PathDiscRespPD::Construct |
( |
MeshPacket & |
packet, |
|
|
uint8_t |
sourceAddr, |
|
|
uint8_t |
destAddr, |
|
|
MeshMAC |
MAC, |
|
|
uint8_t |
ReqID |
|
) |
| |
|
inlinestatic |
Constructs packet of current type.
- Parameters
-
[in] | packet | System packet to construct. |
| sourceAddr | Source node address. |
| destAddr | Destination node address. |
| MAC | MAC address of node, which sends response to packet discovery. |
| ReqID | ID of path discovery packet, this response belongs to. |
- Returns
- Returns true when packet was constructed successfully.
◆ GetMAC()
Gets MAC address of node, which evoked packet discovery.
- Parameters
-
[in] | packet | System packet to decode. |
- Returns
- MAC address of node, which evoked packet discovery.
- Warning
- Always check, if packet is valid using IsValid() method returns true, else exception can be thrown.
◆ GetReqID()
static uint8_t PathDiscRespPD::GetReqID |
( |
const MeshPacket & |
packet | ) |
|
|
inlinestatic |
Gets ID of path discovery packet, this response belongs to.
- Parameters
-
[in] | packet | System packet to decode. |
- Returns
- ID of path discovery packet, this response belongs to.
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ IsSameType()
static bool PathDiscRespPD::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 PathDiscRespPD::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 PathDiscRespPD::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.
◆ SetMAC()
Sets MAC address of node, which evoked packet discovery.
- Parameters
-
[in] | packet | System packet to decode. |
| MAC | MAC address of node, which sends response to packet discovery. |
- Warning
- Always check, if packet is valid using IsValid() method returns true, else exception can be thrown.
◆ SetReqID()
static void PathDiscRespPD::SetReqID |
( |
MeshPacket & |
packet, |
|
|
uint8_t |
ReqID |
|
) |
| |
|
inlinestatic |
Sets ID of path discovery packet, this response belongs to.
- Parameters
-
[in] | packet | System packet to decode. |
| ReqID | ID of path discovery packet, this response belongs to. |
- Warning
- Always check, if packet is valid using IsValid() method, else exception can be thrown.
◆ Type
Type of system packet, that can be decoded with current decoder.
The documentation for this class was generated from the following file: