Quick Start#

This library introduces a Frame object. It will contain all the data about a BEEP Frame. It can be a Message, a Reply, an Answer, a Null and an Error, which define the object stored in Frame.state.header_type.

from galaxy_beep_frame import (
    ContinuationIndicator,
    Frame,
    PossibleHeaderType,
)

frame = Frame(
    payload = b"content of the frame",
    channel_number = 0,
    message_number = 0,
    sequence_number = 0,
    possible_header_type = PossibleHeaderType.MSG,
    answer_number = None,
    continuation_indicator = ContinuationIndicator.COMPLETE,
)

An Answer frame needs a non-None answer_number. Other frame type will require a None answer_number. All types must have a continuation_indicator, only Null frame must have a ContinuationIndicator.COMPLETE. Others frame also accept a ContinuationIndicator.INTERMEDIATE.