Go to the documentation of this file.
14 #ifndef MESH_PACKET_DECODERS_H
15 #define MESH_PACKET_DECODERS_H
57 return (frameDataSize == 4 || frameDataSize == 8)
58 && frameData[0] == (uint8_t)
Type
101 packet[2] = ACK_Source;
140 packet[3] = ExpectedSize;
147 return packet.
Length() == 8;
154 return frameDataSize == 8;
164 return MeshMAC(packet[4], packet[5], packet[6], packet[7]);
174 return MeshMAC(frameData[4], frameData[5], frameData[6], frameData[7]);
184 packet[4] = foreignBSSID.
octet1;
185 packet[5] = foreignBSSID.
octet2;
186 packet[6] = foreignBSSID.
octet3;
187 packet[7] = foreignBSSID.
octet4;
200 static bool Construct(
MeshPacket& packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, uint8_t ExpectedSize = 0) {
227 static bool Construct(
MeshPacket& packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source,
MeshMAC foreignBSSID, uint8_t ExpectedSize = 0) {
247 const static SystemPacketType
Type = SPT_ACK;
309 return (frameDataSize == 6 || frameDataSize == 10)
310 && frameData[0] == (uint8_t)
Type
353 packet[2] = ACK_Source;
392 packet[3] = ExpectedSize;
414 *(uint8_t*)(packet.
p_ptr() + 4) = (uint8_t)ErrorCode;
424 return *(uint8_t*)(packet.
p_ptr() + 5);
434 *(uint8_t*)(packet.
p_ptr() + 5) = RepairValue;
441 return packet.
Length() == 10;
448 return frameDataSize == 10;
458 return MeshMAC(packet[6], packet[7], packet[8], packet[9]);
468 return MeshMAC(frameData[6], frameData[7], frameData[8], frameData[9]);
478 packet[6] = foreignBSSID.
octet1;
479 packet[7] = foreignBSSID.
octet2;
480 packet[8] = foreignBSSID.
octet3;
481 packet[9] = foreignBSSID.
octet4;
525 static bool Construct(
MeshPacket& packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, uint8_t ExpectedSize,
ERR_ACK_ErrorCode ErrorCode, uint8_t RepairValue = 0) {
653 return (frameDataSize == 5 || frameDataSize == 9)
654 && frameData[0] == (uint8_t)
Type
687 return *(uint16_t*)(packet.
p_ptr() + 3);
697 return *(uint16_t*)(frameData + 3);
707 *(uint16_t*)(packet.
p_ptr() + 3) = flags;
715 return packet.
Length() == 9;
723 return frameDataSize == 9;
734 return MeshMAC(packet[5], packet[6], packet[7], packet[8]);
745 return MeshMAC(frameData[5], frameData[6], frameData[7], frameData[8]);
756 packet[5] = responder.
octet1;
757 packet[6] = responder.
octet2;
758 packet[7] = responder.
octet3;
759 packet[8] = responder.
octet4;
856 return frameDataSize >= 10 && frameDataSize <= 74
857 && frameData[0] == (uint8_t)
Type
890 return *(uint16_t*)(packet.
p_ptr() + 3);
900 *(uint16_t*)(packet.
p_ptr() + 3) = flags;
910 return MeshMAC(packet[5], packet[6], packet[7], packet[8]);
920 return MeshMAC(frameData[5], frameData[6], frameData[7], frameData[8]);
930 packet[5] = foreignBSSID.
octet1;
931 packet[6] = foreignBSSID.
octet2;
932 packet[7] = foreignBSSID.
octet3;
933 packet[8] = foreignBSSID.
octet4;
954 return packet[9] == 255;
975 return (
char*)(packet.
p_ptr()+10);
990 SSID_length = (noTrunc) ?
GetSSIDLength(packet) : (SSID_length - 1);
991 memcpy(SSID, (
void*)(packet.
p_ptr() + 10), SSID_length);
992 SSID[SSID_length] = 0;
1009 return ((packet.
Length() < 10) ? 0 : (packet.
Length() - 10));
1021 static bool SetSSID(
MeshPacket& packet,
const char* SSID, uint8_t SSID_length,
bool resize =
true) {
1022 if (SSID_length > 64)
return false;
1023 if (SSID == NULL) SSID_length = 0;
1029 if (packet.
Length() > 10) {
1030 if (SSID_length > 0) {
1031 uint8_t minLength = packet.
Length() - 10;
1032 if(SSID_length < minLength) minLength = SSID_length;
1033 memcpy((
void*)(packet.
p_ptr() + 10), SSID, minLength);
1076 if (SSID_length > 64 || SSID == NULL)
return false;
1088 uint8_t minLength = packet.
Length() - 10;
1089 if(SSID_length < minLength) minLength = SSID_length;
1090 memcpy((
void*)(packet.
p_ptr() + 10), SSID, minLength);
1147 uint8_t minLength = packet.
Length() - 10;
1149 memcpy((
void*)(packet.
p_ptr() + 10), result.
SSID_ptr, minLength);
1205 return frameDataSize == 9
1206 && frameData[0] == (uint8_t)
Type
1219 return *(uint16_t*)(packet.
p_ptr() + 1);
1229 *(uint16_t*)(packet.
p_ptr() + 1) = flags;
1239 return MeshMAC(packet[3], packet[4], packet[5], packet[6]);
1249 return MeshMAC(frameData[3], frameData[4], frameData[5], frameData[6]);
1259 packet[3] = foreignBSSID.
octet1;
1260 packet[4] = foreignBSSID.
octet2;
1261 packet[5] = foreignBSSID.
octet3;
1262 packet[6] = foreignBSSID.
octet4;
1366 return ((frameDataSize >= 10 && frameDataSize <= 74) || frameDataSize == 8)
1367 && frameData[0] == (uint8_t)
Type
1380 return *(uint16_t*)(packet.
p_ptr() + 1);
1390 *(uint16_t*)(packet.
p_ptr() + 1) = flags;
1400 return MeshMAC(packet[3], packet[4], packet[5], packet[6]);
1410 return MeshMAC(frameData[3], frameData[4], frameData[5], frameData[6]);
1420 packet[3] = foreignBSSID.
octet1;
1421 packet[4] = foreignBSSID.
octet2;
1422 packet[5] = foreignBSSID.
octet3;
1423 packet[6] = foreignBSSID.
octet4;
1443 packet[7] = address;
1474 packet[7] = (uint8_t)reason;
1484 return *(uint16_t*)(packet.
p_ptr() + 8);
1494 *(uint16_t*)(packet.
p_ptr() + 8) = time;
1505 return (
char*)(packet.
p_ptr() + 10);
1520 SSID_length = (noTrunc) ?
GetSSIDLength(packet) : (SSID_length - 1);
1521 memcpy(SSID, (
void*)(packet.
p_ptr() + 10), SSID_length);
1522 SSID[SSID_length] = 0;
1539 return ((packet.
Length() < 10) ? 0 : (packet.
Length() - 10));
1551 static bool SetSSID(
MeshPacket& packet,
const char* SSID, uint8_t SSID_length,
bool resize =
true) {
1552 if (SSID_length > 64)
return false;
1553 if (SSID == NULL) SSID_length = 0;
1559 if (packet.
Length() > 10) {
1560 if (SSID_length > 0) {
1561 uint8_t minLength = packet.
Length() - 10;
1562 if (SSID_length < minLength) minLength = SSID_length;
1563 memcpy((
void*)(packet.
p_ptr() + 10), SSID, minLength);
1583 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) {
1584 if (SSID_length > 64 || SSID == NULL)
return false;
1596 uint8_t minLength = packet.
Length() - 10;
1597 if (SSID_length < minLength) minLength = SSID_length;
1598 memcpy((
void*)(packet.
p_ptr() + 10), SSID, minLength);
1678 return frameDataSize == 9
1679 && frameData[0] == (uint8_t)
Type
1692 return *(uint16_t*)(packet.
p_ptr() + 1);
1702 *(uint16_t*)(packet.
p_ptr() + 1) = flags;
1712 return MeshMAC(packet[3], packet[4], packet[5], packet[6]);
1722 packet[3] = requesterMAC.
octet1;
1723 packet[4] = requesterMAC.
octet2;
1724 packet[5] = requesterMAC.
octet3;
1725 packet[6] = requesterMAC.
octet4;
1823 return (frameDataSize == 8 || frameDataSize == 10)
1824 && frameData[0] == (uint8_t)
Type
1837 return *(uint16_t*)(packet.
p_ptr() + 1);
1847 *(uint16_t*)(packet.
p_ptr() + 1) = flags;
1857 return MeshMAC(packet[3], packet[4], packet[5], packet[6]);
1867 packet[3] = requesterMAC.
octet1;
1868 packet[4] = requesterMAC.
octet2;
1869 packet[5] = requesterMAC.
octet3;
1870 packet[6] = requesterMAC.
octet4;
1890 packet[7] = address;
1920 packet[7] = (uint8_t)reason;
1930 return *(uint16_t*)(packet.
p_ptr() + 8);
1940 *(uint16_t*)(packet.
p_ptr() + 8) = time;
1954 static bool Construct(
MeshPacket& packet, uint8_t sourceAddr, uint8_t destAddr, uint16_t flags,
MeshMAC requesterMAC, uint8_t address, uint16_t time) {
2051 return frameDataSize == 5
2052 && frameData[0] == (uint8_t)
Type
2065 return MeshMAC(packet[1], packet[2], packet[3], packet[4]);
2152 return frameDataSize == 6
2153 && frameData[0] == (uint8_t)
Type
2166 return MeshMAC(packet[1], packet[2], packet[3], packet[4]);
2292 packet[1] = (uint8_t)disconnectType;
2371 return *(uint16_t*)(packet.
p_ptr() + 1);
2381 *(uint16_t*)(packet.
p_ptr() + 1) = flags;
2391 return *(uint32_t*)(packet.
p_ptr() + 3);
2401 *(uint32_t*)(packet.
p_ptr() + 3) = pingStartTime;
2431 return (packet.
Length() > 8)?(uint8_t*)(packet.
p_ptr() + 8):NULL;
2446 memcpy(testData, (
void*)(packet.
p_ptr() + 8), length);
2462 return ((packet.
Length() < 8) ? 0 : (packet.
Length() - 8));
2476 if (testData == NULL || length < 0) length = 0;
2482 if (packet.
Length() > 8) {
2484 int16_t minLength = packet.
Length() - 8;
2485 if (length < minLength) minLength = length;
2486 memcpy((
void*)(packet.
p_ptr() + 8), testData, minLength);
2503 if (length < 0) length = 0;
2509 if (packet.
Length() > 8) {
2512 for (int16_t i = 8; i < length; i++) {
2513 packet[i] = random(0, 255);
2532 if (testDataLength < 0) testDataLength = 0;
2561 static bool Construct(
MeshPacket& packet, uint8_t sourceAddr, uint8_t destAddr,
MeshPingFlags flags, uint32_t pingStartTime,
const uint8_t* testData, int16_t testDataLength) {
2562 if (testDataLength < 0 || testData == NULL) testDataLength = 0;
2574 SetTestData(packet, testData, testDataLength,
false);
2590 #endif // !MESH_PACKET_DECODERS_H
static void SetReservedTime(MeshPacket &packet, uint16_t time)
Sets reserved time in DHCP table in minutes.
Definition: meshPacketDecoders.h:1493
static uint16_t GetReservedTime(const MeshPacket &packet)
Gets reserved time in DHCP table in minutes.
Definition: meshPacketDecoders.h:1929
Structure, which holds network scan result.
Definition: meshPacketFlags.h:452
static void SetFlags(MeshPacket &packet, uint16_t flags)
Sets network connect flags.
Definition: meshPacketDecoders.h:1846
uint8_t Address
Address of node.
Definition: meshPacketFlags.h:461
static uint16_t GetSSIDLength(const MeshPacket &packet)
Gets length of SSID.
Definition: meshPacketDecoders.h:1008
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:1808
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.
Definition: meshPacketDecoders.h:855
Ping packets flags.
Definition: meshPacketFlags.h:374
static uint16_t GetReservedTime(const MeshPacket &packet)
Gets reserved time in DHCP table in minutes.
Definition: meshPacketDecoders.h:1483
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:2126
static uint32_t GetPingID(const MeshPacket &packet)
Gets ping packet ID.
Definition: meshPacketDecoders.h:2410
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:1653
static uint8_t GetACK_Source(const MeshPacket &packet)
Gets Source of packet (which with ID creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:90
static uint8_t GetACK_Source(const MeshPacket &packet)
Gets Source of packet (which with ID creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:342
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshMAC MAC, uint8_t ReqID)
Constructs packet of current type.
Definition: meshPacketDecoders.h:2211
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:1314
static MeshPingFlags GetFlags(const MeshPacket &packet)
Gets ping packet flags. First flags says, if current packet is response or request.
Definition: meshPacketDecoders.h:2370
@ EAET_SameFrameReceived
Definition: meshPacketDecoders.h:261
Static class, that groups static methods to decode node disconnect packet.
Definition: meshPacketDecoders.h:2249
volatile bool RoutingEnabled
Enables or disables routing. When routing is enabled, packet will contain address of next node,...
Definition: meshPacketFlags.h:51
static void SetFlags(MeshPacket &packet, MeshPingFlags flags)
Sets ping packet flags. First flags says, if current packet is response or request.
Definition: meshPacketDecoders.h:2380
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint16_t flags, MeshMAC requesterMAC, uint8_t address, uint16_t time)
Constructs packet of current type.
Definition: meshPacketDecoders.h:1954
RelNetConRespPD()
Definition: meshPacketDecoders.h:2007
static void SetFlags(MeshPacket &packet, MeshNetScanFlags flags)
Sets network scan flags.
Definition: meshPacketDecoders.h:706
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:830
Static class, that groups static methods to decode network scan response packet.
Definition: meshPacketDecoders.h:823
static bool SetRandomTestData(MeshPacket &packet, int16_t length, bool resize=true)
Sets random test data to ping packet.
Definition: meshPacketDecoders.h:2501
Static class, that groups static methods to decode network connection request packet.
Definition: meshPacketDecoders.h:1172
static void SetForeignNetBSSID(MeshPacket &packet, MeshMAC foreignBSSID)
Sets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:1419
static uint8_t GetExpectedFrameSize(const uint8_t *frameData)
Gets size of frame, which is expected to be received after this acknowledgement. Designed for packet ...
Definition: meshPacketDecoders.h:113
static void SetRefuseReason(MeshPacket &packet, NetConRespRefuseReason reason)
Sets refuse reason when connection was refused.
Definition: meshPacketDecoders.h:1919
static uint16_t GetSSIDLength(const MeshPacket &packet)
Gets length of SSID.
Definition: meshPacketDecoders.h:1538
volatile bool SystemPacket
True when current packet is system packet.
Definition: meshPacketFlags.h:64
static bool SetSSID(MeshPacket &packet, const char *SSID, uint8_t SSID_length, bool resize=true)
Sets SSID of network to packet.
Definition: meshPacketDecoders.h:1551
#define BROADCAST_MESH_ADDRESS
Address, that is used for broadcast. Not implemented yet.
Definition: meshConfig.h:50
static void SetFlags(MeshPacket &packet, uint16_t flags)
Sets network connect flags.
Definition: meshPacketDecoders.h:1389
PingPD()
Definition: meshPacketDecoders.h:2586
static void SetPingID(MeshPacket &packet, uint8_t pingID)
Sets ping packet ID.
Definition: meshPacketDecoders.h:2420
static bool IsForeignNet(const MeshPacket &packet)
Checks if frame is for foreign network.
Definition: meshPacketDecoders.h:440
static uint8_t GetACK_ID(const MeshPacket &packet)
Gets ID of packet (which with Source creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:322
static void SetNetVersion(MeshPacket &packet, MeshVersion version)
Sets version of used MeshNet.
Definition: meshPacketDecoders.h:676
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.
Definition: meshPacketDecoders.h:1677
static MeshVersion GetNetVersion(const MeshPacket &packet)
Gets version of used MeshNet.
Definition: meshPacketDecoders.h:666
static bool IsForeignNet(uint8_t frameDataSize)
Checks if frame is for foreign network. Designed for packet header checking in MeshPacketBuilder.
Definition: meshPacketDecoders.h:153
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.
Definition: meshPacketDecoders.h:2561
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...
Definition: meshPacketDecoders.h:974
@ MNDPT_DisconnectRequest
Definition: meshPacketDecoders.h:2241
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.
Definition: meshPacketDecoders.h:1822
uint8_t octet3
Third octet of MeshMAC address.
Definition: meshHelper.h:216
SystemPacketType GetSystemPacketType() const
Gets type of system packet.
Definition: meshPacket.cpp:119
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:40
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:2583
@ EAET_InvalidPacket
Definition: meshPacketDecoders.h:267
static void SetResponder(MeshPacket &packet, MeshMAC responder)
Sets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods a...
Definition: meshPacketDecoders.h:755
static void SetACK_ID(MeshPacket &packet, uint8_t ACK_ID)
Sets ID of packet (which with Souce creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:80
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 ...
Definition: meshPacketDecoders.h:987
@ EAET_FrameOrderError
Definition: meshPacketDecoders.h:264
static MeshMAC GetRequesterMAC(const MeshPacket &packet)
Gets MAC address of node, which requests network connection.
Definition: meshPacketDecoders.h:1711
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.
Definition: meshPacketDecoders.h:1107
Static class, that groups static methods to decode ACK packet.
Definition: meshPacketDecoders.h:23
Static class, that groups static methods to decode network scan request packet.
Definition: meshPacketDecoders.h:620
Static class, that groups static methods to decode network connection response packet.
Definition: meshPacketDecoders.h:1333
static void SetRequesterMAC(MeshPacket &packet, MeshMAC requesterMAC)
SetsMAC address of node, which requests network connection.
Definition: meshPacketDecoders.h:1866
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, MeshMAC foreignBSSID, uint8_t ExpectedSize=0)
Constructs packet of current type.
Definition: meshPacketDecoders.h:227
ACKPD()
Definition: meshPacketDecoders.h:250
static MeshMAC GetMAC(const MeshPacket &packet)
Gets MAC address of node, which evoked packet discovery.
Definition: meshPacketDecoders.h:2064
#define UNKNOWN_MESH_ADDRESS
Address, of node, when node is not connected to any network.
Definition: meshConfig.h:62
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.
Definition: meshPacketDecoders.h:1204
static uint8_t GetExpectedFrameSize(const uint8_t *frameData)
Gets size of frame, which is expected to be received after this acknowledgement. Designed for packet ...
Definition: meshPacketDecoders.h:365
uint8_t octet1
First octet of MeshMAC address.
Definition: meshHelper.h:226
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:1179
static void SetMAC(MeshPacket &packet, MeshMAC MAC)
Sets MAC address of node, which evoked packet discovery.
Definition: meshPacketDecoders.h:2074
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:2256
static void SetExpectedFrameSize(MeshPacket &packet, uint8_t ExpectedSize)
Sets size of frame, which is expected to be received after this acknowledgement. This has to be used,...
Definition: meshPacketDecoders.h:139
ERR_ACK_ErrorCode
Definition: meshPacketDecoders.h:258
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:1779
static int16_t GetTestDataLength(const MeshPacket &packet)
Gets length of test data.
Definition: meshPacketDecoders.h:2461
static MeshNodeDescFlags GetFlags(const MeshPacket &packet)
Gets network scan response flags.
Definition: meshPacketDecoders.h:889
static MeshVersion GetNetVersion(const MeshPacket &packet)
Gets version of used MeshNet.
Definition: meshPacketDecoders.h:1734
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.
Definition: meshPacketDecoders.h:2531
static MeshMAC GetResponder(const uint8_t *frameData)
Gets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods a...
Definition: meshPacketDecoders.h:744
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:247
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:2328
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, MeshMAC foreignBSSID, ERR_ACK_ErrorCode ErrorCode, uint8_t RepairValue=0)
Constructs packet of current type.
Definition: meshPacketDecoders.h:555
static void SetAssignedAddr(MeshPacket &packet, uint8_t address)
Sets address assigned to node which requested connection.
Definition: meshPacketDecoders.h:1889
MeshPacketHeader PacketHeader
Mesh packet header.
Definition: meshPacket.h:192
static void SetRepairValue(MeshPacket &packet, uint8_t RepairValue)
Sets value, that can be used for solving the error. Some error codes does not contains this value.
Definition: meshPacketDecoders.h:433
volatile bool RelayingEnabled
Enables or disables relaying. When relaying is enabled, can be relayied to nodes, which are not neigh...
Definition: meshPacketFlags.h:58
static void SetDisconnectType(MeshPacket &packet, MeshNetDisconnectPacketType disconnectType)
Sets disconnect packet type.
Definition: meshPacketDecoders.h:2291
static void SetHopsToGateway(MeshPacket &packet, uint8_t hops)
Sets hop count of node to its gateway connection.
Definition: meshPacketDecoders.h:963
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:1663
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, MeshVersion version, MeshNetScanFlags flags, MeshMAC responder)
Constructs packet of current type.
Definition: meshPacketDecoders.h:793
static void SetMAC(MeshPacket &packet, MeshMAC MAC)
Sets MAC address of node, which evoked packet discovery.
Definition: meshPacketDecoders.h:2175
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:1350
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, MeshMAC foreignBSSID, uint8_t ExpectedSize, ERR_ACK_ErrorCode ErrorCode, uint8_t RepairValue=0)
Constructs packet of current type.
Definition: meshPacketDecoders.h:587
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.
Definition: meshPacketDecoders.h:1365
MeshNetDisconnectPacketType
Definition: meshPacketDecoders.h:2239
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshMAC MAC)
Constructs packet of current type.
Definition: meshPacketDecoders.h:2089
@ EAET_None
Definition: meshPacketDecoders.h:259
static MeshMAC GetResponder(const MeshPacket &packet)
Gets responder BSSID or MAC address. To check if responder is BSSID or MAC, call GetFlags() methods a...
Definition: meshPacketDecoders.h:733
static uint8_t GetReqID(const MeshPacket &packet)
Gets ID of path discovery packet, this response belongs to.
Definition: meshPacketDecoders.h:2188
static void SetForeignNetBSSID(MeshPacket &packet, MeshMAC foreignBSSID)
Sets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:477
static MeshMAC GetRequesterMAC(const MeshPacket &packet)
Gets MAC address of node, which requests network connection.
Definition: meshPacketDecoders.h:1856
This file contains class which can be used to handling mesh packets.
PathDiscRespPD()
Definition: meshPacketDecoders.h:2234
static MeshMAC GetForeignNetBSSID(const MeshPacket &packet)
Gets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:1238
static bool SetTestData(MeshPacket &packet, const uint8_t *testData, int16_t length, bool resize=true)
Sets test data to ping packet.
Definition: meshPacketDecoders.h:2474
MeshNodeDescFlags Flags
Mesh node description flags, which describes every node.
Definition: meshPacketFlags.h:469
static void SetNetVersion(MeshPacket &packet, MeshVersion version)
Sets version of used MeshNet.
Definition: meshPacketDecoders.h:1744
static MeshMAC GetForeignNetBSSID(const uint8_t *frameData)
Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking i...
Definition: meshPacketDecoders.h:919
static MeshVersion GetNetVersion(const MeshPacket &packet)
Gets version of used MeshNet.
Definition: meshPacketDecoders.h:1271
@ EAET_FrameSizeExceeded
Definition: meshPacketDecoders.h:262
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:609
static bool IsRefusedConnection(MeshPacket &packet)
Checks if connection is refused.
Definition: meshPacketDecoders.h:1450
Static class, that groups static methods to decode relayied network connection response packet.
Definition: meshPacketDecoders.h:1791
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshNodeDescFlags flags, MeshMAC foreignBSSID, MeshVersion version)
Constructs packet of current type.
Definition: meshPacketDecoders.h:1295
static void SetForeignNetBSSID(MeshPacket &packet, MeshMAC foreignBSSID)
Sets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:929
NetConRespRefuseReason
Definition: meshPacketDecoders.h:1321
static MeshMAC GetForeignNetBSSID(const uint8_t *frameData)
Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking i...
Definition: meshPacketDecoders.h:1248
static MeshMAC GetForeignNetBSSID(const uint8_t *frameData)
Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking i...
Definition: meshPacketDecoders.h:467
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.
Definition: meshPacketDecoders.h:2151
static MeshMAC GetForeignNetBSSID(const MeshPacket &packet)
Gets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:909
Class, that stores mesh packet with it's data. The size of this class can be slightly bigger then rea...
Definition: meshPacket.h:158
static uint8_t GetAssignedAddr(const MeshPacket &packet)
Gets address assigned to node which requested connection.
Definition: meshPacketDecoders.h:1879
static void SetACK_ID(MeshPacket &packet, uint8_t ACK_ID)
Sets ID of packet (which with Source creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:332
static MeshMAC GetForeignNetBSSID(const uint8_t *frameData)
Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking i...
Definition: meshPacketDecoders.h:1409
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:2136
static void SetACK_Source(MeshPacket &packet, uint8_t ACK_Source)
Sets Source of packet (which with ID creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:100
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:2004
static uint8_t GetAssignedAddr(const MeshPacket &packet)
Gets address assigned to node which requested connection.
Definition: meshPacketDecoders.h:1432
static bool IsForeignNet(uint8_t frameDataSize)
Checks if frame is for foreign network. Designed for packet header checking in MeshPacketBuilder.
Definition: meshPacketDecoders.h:447
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, ERR_ACK_ErrorCode ErrorCode, uint8_t RepairValue=0)
Constructs packet of current type.
Definition: meshPacketDecoders.h:495
static ERR_ACK_ErrorCode GetErrorCode(const MeshPacket &packet)
Gets error code, that describes error.
Definition: meshPacketDecoders.h:402
static void SetAssignedAddr(MeshPacket &packet, uint8_t address)
Sets address assigned to node which requested connection.
Definition: meshPacketDecoders.h:1442
static void SetReservedTime(MeshPacket &packet, uint16_t time)
Sets reserved time in DHCP table in minutes.
Definition: meshPacketDecoders.h:1939
static void SetFlags(MeshPacket &packet, MeshNodeDescFlags flags)
Sets network connect flags.
Definition: meshPacketDecoders.h:1701
bool ResizePayload(uint16_t size, bool doNotCopy=false)
Resizes payload.
Definition: meshPacket.cpp:150
static bool HasResponder(const MeshPacket &packet)
Checks if frame has specified responder. If responder BSSID is specified, only nodes with that BSSID ...
Definition: meshPacketDecoders.h:714
const uint8_t * p_ptr() const
Pointer to payload.
Definition: meshPacket.h:315
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshNetDisconnectPacketType disconnectType)
Constructs packet of current type.
Definition: meshPacketDecoders.h:2303
Static class, that groups static methods to decode ping packet.
Definition: meshPacketDecoders.h:2339
MeshMAC BSSID
BSSID of network, the node which responsed is connected to. If node is not connected to any network (...
Definition: meshPacketFlags.h:457
NetConRequestPD()
Definition: meshPacketDecoders.h:1317
static MeshMAC GetMAC(const MeshPacket &packet)
Gets MAC address of node, which evoked packet discovery.
Definition: meshPacketDecoders.h:2165
DisconnectPD()
Definition: meshPacketDecoders.h:2331
static uint8_t * GetTestDataPtr(const MeshPacket &packet)
Gets pointer to test data in ping packet.
Definition: meshPacketDecoders.h:2430
static MeshNetScanFlags GetFlags(const MeshPacket &packet)
Gets network scan flags.
Definition: meshPacketDecoders.h:686
static bool HasResponder(uint8_t frameDataSize)
Checks if frame has specified responder. If responder BSSID is specified, only nodes with that BSSID ...
Definition: meshPacketDecoders.h:722
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:2025
@ EAET_PacketResendNeeded
Definition: meshPacketDecoders.h:266
uint8_t SSID_length
Length of SSID without null terminator. If node is not connected to any network, 0 is set.
Definition: meshPacketFlags.h:482
typedef SPT_NetScan
Definition: meshPacket.h:22
static MeshMAC GetForeignNetBSSID(const uint8_t *frameData)
Gets BSSID of foreign network, which has to receive this frame. Designed for packet header checking i...
Definition: meshPacketDecoders.h:173
typedef SPT_Disconnect
Definition: meshPacket.h:26
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:1798
NetScanRequestPD()
Definition: meshPacketDecoders.h:814
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:292
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:811
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:1633
RelNetConRequestPD()
Definition: meshPacketDecoders.h:1782
Mesh node description flags, which describes every node on connection or when scan is performed.
Definition: meshPacketFlags.h:299
static void SetFlags(MeshPacket &packet, MeshNodeDescFlags flags)
Sets network scan flags.
Definition: meshPacketDecoders.h:899
static void SetACK_Source(MeshPacket &packet, uint8_t ACK_Source)
Sets Source of packet (which with ID creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:352
Static class, that groups static methods to decode relayied network connection request packet.
Definition: meshPacketDecoders.h:1646
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, uint8_t ExpectedSize, ERR_ACK_ErrorCode ErrorCode, uint8_t RepairValue=0)
Constructs packet of current type.
Definition: meshPacketDecoders.h:525
static uint16_t GetFlags(const MeshPacket &packet)
Gets network connect flags.
Definition: meshPacketDecoders.h:1379
static void SetErrorCode(MeshPacket &packet, ERR_ACK_ErrorCode ErrorCode)
Sets error code, that describes error.
Definition: meshPacketDecoders.h:413
static uint8_t GetHopsToGateway(const MeshPacket &packet)
Gets hop count of node to its gateway connection.
Definition: meshPacketDecoders.h:942
@ EAET_SamePacketReceived
Definition: meshPacketDecoders.h:260
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:2346
static void SetForeignNetBSSID(MeshPacket &packet, MeshMAC foreignBSSID)
Sets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:1258
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.
Definition: meshPacketDecoders.h:1614
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:637
MeshVersion Version
MeshNet version, the node is using.
Definition: meshPacketFlags.h:465
uint8_t HopsToGateway
Hops from current node to gateway. If node is gateway (Address == 0) 0 is set.
Definition: meshPacketFlags.h:473
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:2035
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.
Definition: meshPacketDecoders.h:308
Structure that represents physical MAC address used in MeshNEt protocol. MeshMAC address unlike MAC a...
Definition: meshHelper.h:207
static uint8_t GetExpectedFrameSize(const MeshPacket &packet)
Gets size of frame, which is expected to be received after this acknowledgement. This has to be used,...
Definition: meshPacketDecoders.h:126
static void SetNetVersion(MeshPacket &packet, MeshVersion version)
Sets version of used MeshNet.
Definition: meshPacketDecoders.h:879
NetConRespPD()
Definition: meshPacketDecoders.h:1636
static MeshMAC GetForeignNetBSSID(const MeshPacket &packet)
Gets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:163
static MeshNetDisconnectPacketType GetDisconnectType(const MeshPacket &packet)
Gets disconnect packet type.
Definition: meshPacketDecoders.h:2281
static bool GetTestData(const MeshPacket &packet, uint8_t *testData, int16_t &length)
Copyies test data from ping packet to buffer.
Definition: meshPacketDecoders.h:2442
Static class, that groups static methods to decode path discovery packet.
Definition: meshPacketDecoders.h:2018
static void SetFlags(MeshPacket &packet, MeshNodeDescFlags flags)
Sets network connect flags.
Definition: meshPacketDecoders.h:1228
static uint8_t GetExpectedFrameSize(const MeshPacket &packet)
Gets size of frame, which is expected to be received after this acknowledgement. This has to be used,...
Definition: meshPacketDecoders.h:378
#define INVALID_MESH_ADDRESS
Address, that is invalid and cannot be used.
Definition: meshConfig.h:56
static uint32_t GetPingStartTime(const MeshPacket &packet)
Gets time, when ping was sent.
Definition: meshPacketDecoders.h:2390
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.
Definition: meshPacketDecoders.h:1583
static void SetRefuseReason(MeshPacket &packet, NetConRespRefuseReason reason)
Sets refuse reason when connection was refused.
Definition: meshPacketDecoders.h:1473
typedef SPT_ERR_ACK
Definition: meshPacket.h:21
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:1159
static bool IsForeignNet(const MeshPacket &packet)
Checks if frame is for foreign network.
Definition: meshPacketDecoders.h:146
uint16_t Length() const
Length of payload.
Definition: meshPacket.h:197
static MeshNetScanFlags GetFlags(const uint8_t *frameData)
Gets network scan flags.
Definition: meshPacketDecoders.h:696
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint8_t ACK_ID, uint8_t ACK_Source, uint8_t ExpectedSize=0)
Constructs packet of current type.
Definition: meshPacketDecoders.h:200
typedef SPT_Connect
Definition: meshPacket.h:23
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:2108
static MeshVersion GetNetVersion(const MeshPacket &packet)
Gets version of used MeshNet.
Definition: meshPacketDecoders.h:869
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.
Definition: meshPacketDecoders.h:2050
static bool SetSSID(MeshPacket &packet, const char *SSID, uint8_t SSID_length, bool resize=true)
Sets SSID of network to packet.
Definition: meshPacketDecoders.h:1021
static void SetReqID(MeshPacket &packet, uint8_t ReqID)
Sets ID of path discovery packet, this response belongs to.
Definition: meshPacketDecoders.h:2198
static MeshNetScanResult GetResult(const MeshPacket &packet, MeshMAC BSSID)
Converts data from packet to MeshNetScanResult.
Definition: meshPacketDecoders.h:1046
static bool IsRefusedConnection(MeshPacket &packet)
Checks if connection is refused.
Definition: meshPacketDecoders.h:1896
static void SetPingStartTime(MeshPacket &packet, uint32_t pingStartTime)
Sets time, when ping was sent.
Definition: meshPacketDecoders.h:2400
static MeshMAC GetForeignNetBSSID(const MeshPacket &packet)
Gets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:1399
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:1189
static MeshNodeDescFlags GetFlags(const MeshPacket &packet)
Gets network connect flags.
Definition: meshPacketDecoders.h:1218
static void SetExpectedFrameSize(MeshPacket &packet, uint8_t ExpectedSize)
Sets size of frame, which is expected to be received after this acknowledgement. This has to be used,...
Definition: meshPacketDecoders.h:391
#define MESH_PACKET_PAYLOAD_SIZE_LIMIT
Mesh packet payload size limit in bytes. Protects memory from large space allocation.
Definition: meshConfig.h:116
PathDiscPD()
Definition: meshPacketDecoders.h:2111
char * SSID_ptr
Pointer to network name (SSID). If node is not connected to any network, NULL is set.
Definition: meshPacketFlags.h:478
Static class, that groups static methods to decode path discovery response packet.
Definition: meshPacketDecoders.h:2119
static void SetForeignNetBSSID(MeshPacket &packet, MeshMAC foreignBSSID)
Sets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:183
@ MNDPT_Disconnecting
Definition: meshPacketDecoders.h:2240
static void SetNetVersion(MeshPacket &packet, MeshVersion version)
Sets version of used MeshNet.
Definition: meshPacketDecoders.h:1281
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...
Definition: meshPacketDecoders.h:1517
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, MeshVersion version, MeshNetScanFlags flags)
Constructs packet of current type.
Definition: meshPacketDecoders.h:770
static bool Construct(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshNodeDescFlags flags, MeshMAC requesterMAC, MeshVersion version)
Constructs packet of current type.
Definition: meshPacketDecoders.h:1758
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.
Definition: meshPacketDecoders.h:652
static uint8_t GetRepairValue(const MeshPacket &packet)
Gets value, that can be used for solving the error. Some error codes does not contains this value.
Definition: meshPacketDecoders.h:423
@ NCRRR_Refused
Definition: meshPacketDecoders.h:1323
static NetConRespRefuseReason GetRefuseReason(MeshPacket &packet)
Gets refuse reason when connection was refused.
Definition: meshPacketDecoders.h:1904
typedef SPT_PathDiscovery
Definition: meshPacket.h:28
NetScanRespPD()
Definition: meshPacketDecoders.h:1162
Static class, that groups static methods to decode ERR_ACK packet.
Definition: meshPacketDecoders.h:274
const static SystemPacketType Type
Type of system packet, that can be decoded with current decoder.
Definition: meshPacketDecoders.h:2231
@ NCRRR_Full
Definition: meshPacketDecoders.h:1324
static MeshNodeDescFlags GetFlags(const MeshPacket &packet)
Gets network connect flags.
Definition: meshPacketDecoders.h:1691
static bool Construct(MeshPacket &packet, uint8_t destAddr, const MeshNetScanResult &result, MeshMAC foreignBSSID)
Constructs packet of current type.
Definition: meshPacketDecoders.h:1133
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:30
static void SetRequesterMAC(MeshPacket &packet, MeshMAC requesterMAC)
SetsMAC address of node, which requests network connection.
Definition: meshPacketDecoders.h:1721
@ MNDPT_NetworkDrop
Definition: meshPacketDecoders.h:2242
static NetConRespRefuseReason GetRefuseReason(MeshPacket &packet)
Gets refuse reason when connection was refused.
Definition: meshPacketDecoders.h:1458
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:840
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 i...
Definition: meshPacketDecoders.h:953
uint8_t octet2
Second octet of MeshMAC address.
Definition: meshHelper.h:221
@ EAET_AllocationError
Definition: meshPacketDecoders.h:265
static bool ConstructRefused(MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, uint16_t flags, MeshMAC requesterMAC, NetConRespRefuseReason reason)
Constructs refused connection response packet of current type.
Definition: meshPacketDecoders.h:1983
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:282
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:2356
ERR_ACKPD()
Definition: meshPacketDecoders.h:612
typedef SPT_Ping
Definition: meshPacket.h:29
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.
Definition: meshPacketDecoders.h:1075
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.
Definition: meshPacketDecoders.h:56
Structure that represents MeshNet version. Real size of this class is always 2 bytes.
Definition: meshHelper.h:310
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:1340
static uint16_t GetFlags(const MeshPacket &packet)
Gets network connect flags.
Definition: meshPacketDecoders.h:1836
static MeshMAC GetForeignNetBSSID(const MeshPacket &packet)
Gets BSSID of foreign network, which has to receive this frame.
Definition: meshPacketDecoders.h:457
@ NCRRR_None
Definition: meshPacketDecoders.h:1322
uint8_t octet4
Fourth octet of MeshMAC address.
Definition: meshHelper.h:211
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...
Definition: meshPacketDecoders.h:1504
Network scan request flags.
Definition: meshPacketFlags.h:187
static bool IsValid(const MeshPacket &packet)
Checks if packet is valid.
Definition: meshPacketDecoders.h:2266
static bool IsSameType(const MeshPacket &packet)
Checks if system packet type match decoder type, but does not check its validity.
Definition: meshPacketDecoders.h:627
@ NCRRR_Error
Definition: meshPacketDecoders.h:1325
@ EAET_PacketSizeExceeded
Definition: meshPacketDecoders.h:263
static uint8_t GetACK_ID(const MeshPacket &packet)
Gets ID of packet (which with Souce creates unique packet identifier), that is being acknowledged.
Definition: meshPacketDecoders.h:70