id: blocks_unpacked_to_packed_xx
label: Unpacked to Packed
flags: [ python, cpp ]

parameters:
-   id: type
    label: Type
    dtype: enum
    options: [int, short, byte]
    option_attributes:
        fcn: [ii, ss, bb]
    hide: part
-   id: bits_per_chunk
    label: Bits per Chunk
    dtype: int
    default: '2'
-   id: endianness
    label: Endianness
    dtype: raw
    options: [gr.GR_MSB_FIRST, gr.GR_LSB_FIRST]
    option_labels: [MSB, LSB]
-   id: num_ports
    label: Num Ports
    dtype: int
    default: '1'
    hide: part

inputs:
-   domain: stream
    dtype: ${ type }
    multiplicity: ${ num_ports }

outputs:
-   domain: stream
    dtype: ${ type }
    multiplicity: ${ num_ports }

asserts:
- ${ num_ports > 0 }

templates:
    imports: from gnuradio import blocks
    make: blocks.unpacked_to_packed_${type.fcn}(${bits_per_chunk}, ${endianness})

cpp_templates:
    includes: ['#include <gnuradio/blocks/unpacked_to_packed.h>']
    declarations: 'blocks::unpacked_to_packed_${type.fcn}::sptr ${id};'
    make: 'this->${id} = blocks::unpacked_to_packed_${type.fcn}::make(${bits_per_chunk}, ${endianness});'
    translations:
        gr\.: ''

file_format: 1
