id: satellites_endurosat_deframer
label: Endurosat Deframer
category: '[Satellites]/Deframers'

parameters:
-   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.endurosat_deframer(syncword_threshold=${threshold}, options=${options})

documentation: |-
    Deframes Endurosat packets

    These frames are formed by a preamble of 5 0xaa bytes, the 0x7e flag as syncword, followed by one byte indicating the packet length, then the packet (length 0 to 128 bytes), and finally a CRC-16. The CRC-16 applies to the packet and packet length.

    Input:
        A stream of soft symbols containing Endurosat packets

    Output:
        PDUs with the deframed Endurosat packets

    Parameters:
        Syncword threshold: number of bit errors to allow in syncword detection
        Command line options: options to pass down to the block, following the syntax of the gr_satellites command line tool

file_format: 1
