<block>
  <name>Header/Payload Demux</name>
  <key>digital_header_payload_demux</key>
  <import>from gnuradio import digital</import>
  <make>digital.header_payload_demux(
	  $header_len,
	  $items_per_symbol,
	  $guard_interval,
	  $length_tag_key,
	  $trigger_tag_key,
	  $output_symbols,
	  $(type.itemsize),
	  $timing_tag_key,
          $samp_rate,
          $special_tags,
          $header_padding,
    )</make>
  <param>
    <name>Header Length (Symbols)</name>
    <key>header_len</key>
    <type>int</type>
  </param>
  <param>
    <name>Header Padding (Uncertainty / Symbols)</name>
    <key>header_padding</key>
    <value>0</value>
    <type>int</type>
  </param>
  <param>
    <name>Items per symbol</name>
    <key>items_per_symbol</key>
    <type>int</type>
  </param>
  <param>
    <name>Guard Interval (items)</name>
    <key>guard_interval</key>
    <value>0</value>
    <type>int</type>
    <hide>#if $guard_interval then 'none' else 'part'#</hide>
  </param>
  <param>
    <name>Length tag key</name>
    <key>length_tag_key</key>
    <value>"frame_len"</value>
    <type>string</type>
  </param>
  <param>
    <name>Trigger tag key</name>
    <key>trigger_tag_key</key>
    <value>""</value>
    <type>string</type>
    <hide>#if $trigger_tag_key then 'none' else 'part'#</hide>
  </param>
  <param>
    <name>Output Format</name>
    <key>output_symbols</key>
    <type>enum</type>
    <option>
      <name>Items</name>
      <key>False</key>
    </option>
    <option>
      <name>Symbols</name>
      <key>True</key>
    </option>
  </param>
  <param>
    <name>IO Type</name>
    <key>type</key>
    <type>enum</type>
    <option>
      <name>Complex</name>
      <key>complex</key>
      <opt>itemsize:gr.sizeof_gr_complex</opt>
    </option>
    <option>
      <name>Float</name>
      <key>float</key>
      <opt>itemsize:gr.sizeof_float</opt>
    </option>
    <option>
      <name>Int</name>
      <key>int</key>
      <opt>itemsize:gr.sizeof_int</opt>
    </option>
    <option>
      <name>Short</name>
      <key>short</key>
      <opt>itemsize:gr.sizeof_short</opt>
    </option>
     <option>
      <name>Byte</name>
      <key>byte</key>
      <opt>itemsize:gr.sizeof_char</opt>
    </option>
  </param>
  <param>
    <name>Timing tag key</name>
    <key>timing_tag_key</key>
    <value>"rx_time"</value>
    <type>string</type>
  </param>
  <param>
    <name>Sampling Rate</name>
    <key>samp_rate</key>
    <value>samp_rate</value>
    <type>int</type>
  </param>
  <param>
    <name>Special Tag Keys</name>
    <key>special_tags</key>
    <value>(,)</value>
    <type>raw</type>
  </param>
  <sink>
    <name>in</name>
    <type>$type</type>
  </sink>
  <sink>
    <name>trigger</name>
    <type>byte</type>
    <optional>1</optional>
  </sink>
  <sink>
    <name>header_data</name>
    <type>message</type>
  </sink>
  <source>
    <name>out_hdr</name>
    <type>$type</type>
    <vlen>{True: $items_per_symbol, False: 1}[$output_symbols]</vlen>
  </source>
  <source>
    <name>out_payload</name>
    <type>$type</type>
    <vlen>{True: $items_per_symbol, False: 1}[$output_symbols]</vlen>
  </source>
</block>
