Lib Sub-System: Packet

01 While Semys Arch uses message objects for data transportation, Semys Lib uses packets. Basically both do the same, but the packets are a bit simpler.
02 The basic packet structure is SemysPacket. It contains a type identification and function references to a type specific encoder, decoder and destroy function.
03 The type identification is very limited, because it may use only 5 bits, allowing a total of 32 packets. (The remaining three bits of the byte are reserved.) Currently, Semys Lib is well below this limit and without further requirements.
04 The type identification is limited to 5 bits because the remaining 3 bits in the byte are used to specify how many bits within the serialized byte array are not used for the bitstream.
This way, the packets can be transported via traditional byte oriented means and the packet functions handle the correct bit length internally.
05 Every data packet must contain SemysPacket as its first member.
06 Packets are created in two ways:
  • Dynamically through SemysPacketDecode() (receiving side). Such a packet must be destroyed using SemysPacketDestroy() which will free the allocated memory.
  • Statically at the transmitting side. Here the user code stays in control of the referenced memory and has to handle it accordingly.
07 Structures:
08 Functions:
09 Packets:
10 Reference: SemysPacket.h
Implementation: Semys Library

Goto: Main Page; This page is part of the Semys software documentation. See About: Documentation for details.