piermesh/docs/Packets/Packet.md

48 lines
767 B
Markdown
Raw Normal View History

2024-08-01 22:03:59 +00:00
<a id="base-packet"></a>
2024-07-28 11:21:15 +00:00
# Base packet
2024-08-01 01:00:46 +00:00
### *class* Packets.Packet.Packet(data: bytes, packetsID: int = -1, packetNumber=False, packetCount: int = 1, packetsClass: int = -1)
Base class for Packets
#### data
Data part this packet is delivering (usually none when creating a header packet)
* **Type:**
bytes
#### packetsID
6 digit (maximum) ID for parent Message (TODO: Change to MessageID)
* **Type:**
int
#### packetNumber
Index of packet or False
#### packetCount
Number of packets in parent Message
* **Type:**
int
#### packetsClass
3 digit (maximum) class/protocol for message (TODO: Chajge to messageProtocol)
* **Type:**
int
#### dump()
Dump packet to msgpack encoded binary data
#### parsePayload()
Parse bytes to Packet (TODO: Fix)