MeshNet
1.0.0
|
Static class, that groups static methods to decode ping 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 MeshPingFlags | GetFlags (const MeshPacket &packet) |
Gets ping packet flags. First flags says, if current packet is response or request. More... | |
static void | SetFlags (MeshPacket &packet, MeshPingFlags flags) |
Sets ping packet flags. First flags says, if current packet is response or request. More... | |
static uint32_t | GetPingStartTime (const MeshPacket &packet) |
Gets time, when ping was sent. More... | |
static void | SetPingStartTime (MeshPacket &packet, uint32_t pingStartTime) |
Sets time, when ping was sent. More... | |
static uint32_t | GetPingID (const MeshPacket &packet) |
Gets ping packet ID. More... | |
static void | SetPingID (MeshPacket &packet, uint8_t pingID) |
Sets ping packet ID. More... | |
static uint8_t * | GetTestDataPtr (const MeshPacket &packet) |
Gets pointer to test data in ping packet. More... | |
static bool | GetTestData (const MeshPacket &packet, uint8_t *testData, int16_t &length) |
Copyies test data from ping packet to buffer. More... | |
static int16_t | GetTestDataLength (const MeshPacket &packet) |
Gets length of test data. More... | |
static bool | SetTestData (MeshPacket &packet, const uint8_t *testData, int16_t length, bool resize=true) |
Sets test data to ping packet. More... | |
static bool | SetRandomTestData (MeshPacket &packet, int16_t length, bool resize=true) |
Sets random test data to ping packet. More... | |
static bool | Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshPingFlags flags, uint32_t pingStartTime, int16_t testDataLength=0) |
Constructs packet of current type. More... | |
static bool | Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshPingFlags flags, uint32_t pingStartTime, const uint8_t *testData, int16_t testDataLength) |
Constructs packet of current type. More... | |
Static Public Attributes | |
const static SystemPacketType | Type = SPT_Ping |
Type of system packet, that can be decoded with current decoder. More... | |
Private Member Functions | |
PingPD () | |
Static class, that groups static methods to decode ping packet.
|
inlineprivate |
|
inlinestatic |
Constructs packet of current type.
sourceAddr | Source node address. | |
destAddr | Destination node address. | |
[in] | packet | System packet to construct. |
flags | Ping packet flags. | |
pingStartTime | Time when ping was sent in [ms]. Note, that this is time from program start, that can be get using millis() function. | |
testData | Buffer containing test data. | |
testDataLength | Length of test data buffer. Allowed values: 0-500. |
|
inlinestatic |
Constructs packet of current type.
sourceAddr | Source node address. | |
destAddr | Destination node address. | |
[in] | packet | System packet to construct. |
flags | Ping packet flags. | |
pingStartTime | Time when ping was sent in [ms]. Note, that this is time from program start, that can be get using millis() function. | |
testDataLength | Length of test data. Allowed values: 0-500. Test data are randomly generated. |
|
inlinestatic |
Gets ping packet flags. First flags says, if current packet is response or request.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets ping packet ID.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets time, when ping was sent.
[in] | packet | System packet to decode. |
|
inlinestatic |
Copyies test data from ping packet to buffer.
[in] | packet | System packet to decode. |
[out] | testData | Buffer, where test data will be copyied. Buffer has to have minimum size of number that returns GetTestDataLength() in bytes. |
[in,out] | length | Input size of buffer first, after calling this method it contains length of test data. |
|
inlinestatic |
Gets length of test data.
[in] | packet | System packet to decode. |
|
inlinestatic |
Gets pointer to test data in ping 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 |
Sets ping packet flags. First flags says, if current packet is response or request.
[in] | packet | System packet to decode. |
flags | Ping packet scan flags. |
|
inlinestatic |
Sets ping packet ID.
[in] | packet | System packet to decode. |
pingID | Ping packet ID. If this is request, this can be unset. If this is response, ID is same as request packet ID. |
|
inlinestatic |
Sets time, when ping was sent.
[in] | packet | System packet to decode. |
pingStartTime | Time when ping was sent in [ms]. Note, that this is time from program start, that can be get using millis() function. |
|
inlinestatic |
Sets random test data to ping packet.
length | Length of test data. Allowed values: 0-500. |
resize | Set to true to automatically resize packet payload to fit test data. It is recommended to set it to true. Advanced: Set to false if packet payload can already fit test data without resizing. |
|
inlinestatic |
Sets test data to ping packet.
[in] | testData | Test data to set. |
length | Length of test data. Allowed values: 0-500. | |
resize | Set to true to automatically resize packet payload to fit test data. It is recommended to set it to true. Advanced: Set to false if packet payload can already fit test data without resizing. |
|
static |
Type of system packet, that can be decoded with current decoder.