This class can build packet from multiple frames. It is usually used to concatinate data from packet, that was splitted into multiple frames in carriage, because of packet size. This class also checks if frame needs to be built (if is not carriage frame, so packet is not splitted) and converts this frame to packet.
More...
|
MeshPacketBuilderStatus | Append (const uint8_t *rawData, uint8_t rawDataSize, int8_t rssi) |
| Appends MeshFrame (that will be created from raw data) to packet builder. More...
|
|
MeshPacketBuilderStatus | Append (MeshFrame &frame, int8_t rssi) |
| Appends MeshFrame to packet builder. More...
|
|
MeshPacketBuilderStatus | Append (MeshFrameHeader frameHeader, const uint8_t *data, uint8_t dataSize, int8_t rssi) |
| Appends MeshFrame (that will be created from frameHeader and frame data) to packet builder. More...
|
|
void | Clear () |
| Clears all appended data and last packet. More...
|
|
void | SetFrameReceivedCallback (void(*callback)(MeshPacketBuilder *, MeshPacketBuilderStatus, const MeshFrameHeader &, const uint8_t *, uint8_t, int8_t)) |
| Sets callback function, that is called when valid frame is received. This function can be used to calculate CTS delay time. More...
|
|
void | SetPacketCheckCallback (bool(*callback)(MeshPacketBuilder *, const MeshPacketHeader &, MeshMAC, SystemPacketType, const uint8_t *, uint8_t, int8_t)) |
| Sets callback function, that is called when new packet is going to start build. This callback function has to decide, if packet can be build or has to be ignored. If this callback function is not set, all packet will be received. More...
|
|
void | SetMaxFrameSize (uint8_t size) |
| Sets maximum frame size. Defaultly set to 32. More...
|
|
uint8_t | GetMaxFrameSize () const |
| Gets maximum frame size. More...
|
|
uint16_t | GetPredictedMinPacketDataLength () const |
| Gets minimum predicted packet data length in bytes of packet, that is currently being built. More...
|
|
uint16_t | GetPredictedMaxPacketDataLength () const |
| Gets maximum predicted packet data length in bytes of packet, that is currently being built. More...
|
|
bool | IsEmpty () const |
| Checks if any packet was built or being built or had an error at built. More...
|
|
MeshPacketBuilderStatus | GetStatus () const |
| Gets status of packet, that was built or is being built or had build error. Ignored frames are not reflected in this status. More...
|
|
bool | PacketIsBuilding () const |
| Checks if packet is building right now and is not already built. More...
|
|
bool | PacketAvailable () const |
| Checks if packet was built. If yes, you can get it using method GetBuiltPacket(). More...
|
|
bool | HasError () const |
| Checks if any error happened during packet building. More...
|
|
const MeshPacket & | GetBuiltPacket () const |
| Gets packet, that was built. More...
|
|
MeshPacket & | GetBuiltPacket () |
| Gets packet, that was built. More...
|
|
MeshPacket && | TakeBuiltPacket () |
| Takes packet, that was built and calls clear method. More...
|
|
MeshMAC | GetLastPacketBSSID () const |
| Gets BSSID of last packet. More...
|
|
SystemPacketType | GetLastPacketSystemType () const |
| Gets system packet type of last packet. If packet is not system packet, SPT_ERROR is returned. More...
|
|
MeshPacketHeader | GetLastPacketHeader () const |
| Gets header of last packet. More...
|
|
MeshFrameControl | GetLastPacketFrameControl () const |
| Gets frame control of last packet. More...
|
|
uint8_t | RemainingCarriageFramesCount () const |
| Count of remaining frames in carriage. More...
|
|
uint8_t | CarriageFramesCount () const |
| Count of all frames the packet was splitted at. More...
|
|
uint8_t | ReceivedFramesCount () const |
| Gets count of received frames from current packet. More...
|
|
int8_t | GetAverageRSSI () const |
| Gets average RSSI of received packet's frames. More...
|
|
int8_t | GetMinRSSI () const |
| Gets minimum RSSI of received packet's frames. More...
|
|
uint32_t | GetAppendingEndTime () const |
| Gets time, when appending of last packet has ended. This can be used as time, when was last part of that packet received. More...
|
|
This class can build packet from multiple frames. It is usually used to concatinate data from packet, that was splitted into multiple frames in carriage, because of packet size. This class also checks if frame needs to be built (if is not carriage frame, so packet is not splitted) and converts this frame to packet.
Carriage
Carriage is set of frames which was splitted. The first frame in carriage is called header frame or head frame. It contains all packet header fields and part of data. Other frames are called only carriage frames, they contains only necessary frame header fields to identify frame and another part of data. Every carriage contains count of remaining frames. This is field called CarriageCount. Those carriage frames has to be sorted by CarriageCount.
- See also
- meshPacketBuilder.h
-
MeshPacketSplitter
-
MeshNet
-
MeshPacket
-
MeshFrame