LoRaMesher Library  0.0.5
A LoRa Mesh library for the IoT
AppPacket.h
1#ifndef _LORAMESHER_APPPACKET_H
2#define _LORAMESHER_APPPACKET_H
3
4
10template <class T>
11class AppPacket {
12public:
17 uint16_t dst;
18
23 uint16_t src;
24
29 uint32_t payloadSize = 0;
30
36
44 size_t getPayloadLength() { return this->payloadSize / sizeof(T); }
45
51 void operator delete(void* p) {
52 Log.traceln(F("Deleting app packet"));
53 free(p);
54 }
55};
56
57#endif
Application packet, it is used to send the packet to the application layer.
Definition: AppPacket.h:11
uint16_t src
Source Address.
Definition: AppPacket.h:23
uint32_t payloadSize
Payload Size in bytes.
Definition: AppPacket.h:29
size_t getPayloadLength()
Get the payload length in number of T.
Definition: AppPacket.h:44
T payload[]
Payload Array.
Definition: AppPacket.h:35
uint16_t dst
Destination address, normally it will be local address or BROADCAST_ADDR.
Definition: AppPacket.h:17