API Reference

class chapter10.c10.C10(f)

A Chapter 10/11 parser.

Parameters

f (file or str) – A file like object or file path to read from.

classmethod from_string(s)

Create a C10 object from a string or bytes.

class chapter10.packet.Packet(file, **header)

Base class for the various datatypes.

Parameters
  • file (file-like) – Source file to read from.

  • header – Initial header values. Read from file if not provided.

Chapter 10 Header

sync_pattern
channel_id
packet_length
data_length
header_version
sequence_number
secondary_header
ipts_source
rtc_sync_error
data_overflow_error
secondary_format
data_checksum_present
data_type
rtc
header_checksum

Secondary Header (if present)

time
secondary_checksum

Other Attributes

FORMAT: BitFormat

Description of the chapter 10 header

SECONDARY_FORMAT: BitFormat

Describes the secondary header

csdw_format: BitFormat = None

Describes a datatype’s channel specific data word (CSDW)

exception chapter10.packet.InvalidPacket
class chapter10.packet.Message(data, parent=None, **kwargs)

The base container for packet message data.

Parameters
  • data (bytes) – The binary data to be stored. May be empty (for instance, if FORMAT fully describes the format).

  • parent (Packet) – The Packet object this message belongs to.

  • kwargs – Arbitrary key-value pairs to add as attributes to the item instance. Used for IPH values.

Class Attributes

FORMAT: BitFormat = None

Describes the intra-packet header (IPH) or message format in general.

length: int = 0

Byte size of message body. If not specified will look for a ‘length’ field in the IPH.

Instance Attributes

parent: Packet

The Packet object this message is attached to.

data: bytes

Raw data not identified in FORMAT