id: digital_protocol_formatter_bb
label: Protocol Formatter
flags: [ python, cpp ]

parameters:
-   id: format
    label: Format Obj.
    dtype: raw
-   id: len_tag_key
    label: Length Tag Name
    dtype: string
    default: '"packet_len"'

inputs:
-   domain: stream
    dtype: byte

outputs:
-   domain: stream
    dtype: byte

templates:
    imports: from gnuradio import digital
    make: digital.protocol_formatter_bb(${format}, ${len_tag_key})
    callbacks:
    - set_header_format(${format})

cpp_templates:
    includes: ['#include <gnuradio/digital/protocol_formatter_bb.h>']
    declarations: 'digital::protocol_formatter_bb::sptr ${id};'
    make: 'this->${id} = digital::protocol_formatter_bb::make(${format}, ${len_tag_key});'
    link: ['gnuradio::gnuradio-digital']
    callbacks:
    - set_header_format(${format})

file_format: 1
