id: satellites_ccsds_concatenated_deframer
label: CCSDS Concatenated Deframer
category: '[Satellites]/Deframers'

parameters:
-   id: frame_size
    label: Frame size (bytes)
    dtype: int
    default: 223
-   id: precoding
    label: Precoding
    dtype: enum
    default: 'None'
    options: ['None', '"differential"']
    option_labels: ['None', 'Differential']
-   id: rs_basis
    label: Reed-Solomon basis
    dtype: enum
    default: '"dual"'
    options: ['"conventional"', '"dual"']
    option_labels: [Conventional, Dual]
-   id: rs_interleaving
    label: Reed-Solomon interleave depth
    default: 1
    dtype: int
-   id: scrambler
    label: Scrambler
    dtype: enum
    default: '"CCSDS"'
    options: ['"CCSDS"', '"none"']
    option_labels: [CCSDS, None]
-   id: convolutional
    label: Convolutional code
    dtype: enum
    default: '"CCSDS"'
    options: ['"CCSDS"', '"NASA-DSN"', '"CCSDS uninverted"', '"NASA-DSN uninverted"']
    option_labels: [CCSDS, NASA-DSN, CCSDS uninverted, NASA-DSN uninverted]
-   id: threshold
    label: Syncword threshold
    dtype: int
    default: 0
-   id: options
    label: Command line options
    dtype: string
    default: '""'
    hide: part

inputs:
-   domain: stream
    dtype: float

outputs:
-   domain: message
    id: out

templates:
    imports: import satellites.components.deframers
    make: satellites.components.deframers.ccsds_concatenated_deframer(frame_size = ${frame_size}, precoding = ${precoding}, rs_basis = ${rs_basis}, rs_interleaving = ${rs_interleaving}, scrambler = ${scrambler}, convolutional = ${convolutional}, syncword_threshold = ${threshold}, options=${options})

documentation: |-
    Deframes a signal using the CCSDS concatenated TM protocol

    Input:
        A stream of soft symbols containing packets using the CCSDS concatenated TM protocol

    Output:
        PDUs with the deframed packets

    Parameters:
        Frame size (bytes): the size of the frame in bytes, after Reed-Solomon decoding
        Precoding: selects no precoding or differential precoding
        Reed-Solomon basis: toggles the usage of the conventional or dual basis definition for the Reed-Solomon code
        Reed-Solomon interleave depth: number of interleaved Reed-Solomon codewords
        Scrambler: enables or disables the CCSDS synchronous scrambler
        Convolutional code: selects the polynomials and inversion branches used to define the convolutional encoder
        Syncword threshold: number of bit errors to allow in the detection of the 32 bit syncword
        Command line options: options to pass down to the block, following the syntax of the gr_satellites command line tool

file_format: 1
