id: digital_diff_decoder_bb
label: Differential Decoder
flags: [ python, cpp ]

parameters:
-   id: coding
    label: Coding
    dtype: enum
    default: digital.DIFF_DIFFERENTIAL
    options: [digital.DIFF_DIFFERENTIAL, digital.DIFF_NRZI]
    option_labels: [Differential, NRZI]
    option_attributes:
        hide_modulus: [none, all]
        force_modulus: [-1, 2]
-   id: modulus
    label: Modulus
    dtype: int
    hide: ${ coding.hide_modulus }

inputs:
-   domain: stream
    dtype: byte

outputs:
-   domain: stream
    dtype: byte

templates:
    imports: from gnuradio import digital
    make: digital.diff_decoder_bb(${modulus if coding.force_modulus == '-1' else coding.force_modulus}, ${coding})

cpp_templates:
    includes: ['#include <gnuradio/digital/diff_decoder_bb.h>']
    declarations: 'digital::diff_decoder_bb::sptr ${id};'
    make: |-
        this->${id} = digital::diff_decoder_bb::make(${modulus if coding.force_modulus == '-1' else coding.force_modulus}, ${coding});
    link: ['gnuradio::gnuradio-digital']
    translations:
        digital\.DIFF: 'digital::DIFF'

file_format: 1
