id: digital_ofdm_cyclic_prefixer
label: OFDM Cyclic Prefixer
flags: [ python, cpp ]

parameters:
-   id: input_size
    label: FFT Length
    dtype: int
    default: fft_len
-   id: cp_len
    label: CP Length(s)
    dtype: raw
    default: fft_len/4
-   id: rolloff
    label: Rolloff
    dtype: int
    default: '0'
    hide: ${ ('none' if rolloff else 'part') }
-   id: tagname
    label: Length Tag Key
    dtype: string
    default: '"frame_len"'

inputs:
-   domain: stream
    dtype: complex
    vlen: ${ input_size }

outputs:
-   domain: stream
    dtype: complex

templates:
    imports: from gnuradio import digital
    make: |-
        digital.ofdm_cyclic_prefixer(
            ${input_size},
        % if isinstance(context.get('cp_len')(), (tuple, list)):
            ${cp_len},
        % else:
            ${input_size} + ${cp_len},
        % endif
            ${rolloff},
            ${tagname})

cpp_templates:
    includes: ['#include <gnuradio/digital/ofdm_cyclic_prefixer.h>']
    declarations: 'digital::ofdm_cyclic_prefixer::sptr ${id};'
    make: |-
        this->${id} = digital::ofdm_cyclic_prefixer::make(
            ${input_size},
        % if isinstance(context.get('cp_len')(), (tuple, list)):
            ${cp_len},
        % else:
            ${input_size} + ${cp_len},
        % endif
            ${rolloff},
            ${tagname});
    link: ['gnuradio::gnuradio-digital']

file_format: 1
