Module packet

Module packet 

Source

Structs§

PacketNoPayload
Header and trailer packets in-memory representation
PacketWithPayload
Payload packets in-memory representation

Traits§

Packet
Packets both with and without a payload must implement these traits

Functions§

get_alert
Helper function to get a new PacketNoPayload object for the “Alert” OpCode
get_alert_packets
Public function to get the alert packet as array of bytes.
get_end
Helper function to get a new PacketNoPayload object for the “End” OpCode
get_end_packets
Public functinon to get the end packet as an array of bytes.
get_payload
Helper function to get an array of PacketWithPayload(s) to transmit the payload_bytes this function splits the payload_bytes into 80 byte chunks and orders them appropriately for Poly phone consumption
get_payload_packet
Public function to get a single payload packet as an array of bytes. Takes the payload as a [u8; 80], aka, an 80 byte array Must also include the last chunk of payload. On the first packet, the last_chunk must equal the payload_chunk
get_payload_packets
Helper function to get an array of another array of bytes, from get_payload to transmit the actual packets rather than the internal representation of an array of PacketWithPayload(s)