Skip to main content

Module sv

Module sv 

Source
Expand description

Custom binary encoding/decoding for datagrams Encoding and decoding of the custom binary datagram format used in the datagrams bytes field of StreamPacket.

Wire format for a sequence of datagrams (concatenated, no count prefix):

for each datagram:
  [payload_len: u16 big-endian]
  [timestamp:   i64 big-endian]
  [sample_count: u16 big-endian]
  [clock_synch:  u8]
  [flags_len:    u16 big-endian]
  [flags:        flags_len bytes]
  [gm_id_len:    u8]
  [gm_identity:  gm_id_len bytes]
  [values:       N × i64 big-endian]

Functions§

decode_datagrams
Decode a sequence of datagrams from the custom binary format.
encode_datagrams
Encode a slice of datagrams into the custom binary format.