id: satellites_ao40_fec_deframer
label: AO-40 FEC Deframer
category: '[Satellites]/Deframers'

parameters:
-   id: threshold
    label: Syncword threshold
    dtype: int
    default: 0
-   id: short_frames
    label: Use short frames (SMOG-P)
    dtype: bool
    default: 'False'
    options: ['True', 'False']
-   id: crc
    label: Use CRC-16 ARC
    dtype: bool
    default: 'False'
    options: ['True', 'False']
-   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.ao40_fec_deframer(syncword_threshold = ${threshold}, short_frames = ${short_frames}, crc = ${crc}, options=${options})

documentation: |-
    Deframes a signal using the AO-40 FEC protocol

    Input:
        A stream of soft symbols containing packets using the AO-40 FEC protocol

    Output:
        PDUs with the deframed packets

    Parameters:
        Syncword threshold: number of bit errors to allow in the detection of the 32 bit syncword
        Use short frames (SMOG-P): enable usage of short frames, which is a variant employed by SMOG-P and ATL-1
        Use CRC-16 ARC: use CRC-16 ARC (used in SMOG-1)
        Command line options: options to pass down to the block, following the syntax of the gr_satellites command line tool

file_format: 1
