id: blocks_interleaved_char_to_complex
label: IChar To Complex
flags: [ python, cpp ]

parameters:
-   id: scale_factor
    label: Scale Factor
    dtype: float
    default: '1.0'
-   id: vector_input
    label: Vector Input
    dtype: enum
    default: 'False'
    options: ['False', 'True']
    option_labels: ['No', 'Yes']
    option_attributes:
        vlen: [1, 2]

inputs:
-   domain: stream
    dtype: byte
    vlen: ${ vector_input.vlen }

outputs:
-   domain: stream
    dtype: complex

templates:
    imports: from gnuradio import blocks
    make: blocks.interleaved_char_to_complex(${vector_input},${scale_factor})
    callbacks:
    - set_scale_factor(${scale_factor})

cpp_templates:
    includes: ['#include <gnuradio/blocks/interleaved_char_to_complex.h>']
    declarations: 'blocks::interleaved_char_to_complex::sptr ${id};'
    make: 'this->${id} = blocks::interleaved_char_to_complex::make(${vector_input});'
    callbacks:
    - set_scale_factor(${scale_factor})

documentation: |-
    This block converts interleaved IQ bytes to a float complex data type.  
    The default scale factor is 1.0 for backward compatibility, however if 
    the inputs are signed voltage style bytes (-127 to 127) the scale factor
    should be set to 127.0 (SCHAR_MAX). 

file_format: 1
