Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- parameters:
- author: Barry Duggan
- catch_exceptions: 'True'
- category: Custom
- cmake_opt: ''
- comment: ''
- copyright: ''
- description: Generate and parse CRC header
- gen_cmake: 'On'
- gen_linking: dynamic
- generate_options: qt_gui
- hier_block_src_path: '.:'
- id: pkt_7
- max_nouts: '0'
- output_language: python
- placement: (0,0)
- qt_qss_theme: ''
- realtime_scheduling: ''
- run: 'True'
- run_command: '{python} -u {filename}'
- run_options: prompt
- sizing_mode: fixed
- thread_safe_setters: ''
- title: pkt_7
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [16, 12.0]
- rotation: 0
- state: enabled
- blocks:
- - name: hdr_format
- id: variable
- parameters:
- comment: ''
- value: digital.header_format_crc(len_key, num_key)
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [512, 12.0]
- rotation: 0
- state: enabled
- - name: len_key
- id: variable
- parameters:
- comment: ''
- value: '"packet_len"'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [280, 12.0]
- rotation: 0
- state: enabled
- - name: num_key
- id: variable
- parameters:
- comment: ''
- value: '"packet_num"'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [392, 12.0]
- rotation: 0
- state: enabled
- - name: samp_rate
- id: variable
- parameters:
- comment: ''
- value: 32e3
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [192, 12.0]
- rotation: 0
- state: true
- - name: blocks_message_debug_0
- id: blocks_message_debug
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- en_uvec: 'True'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [112, 232.0]
- rotation: 0
- state: enabled
- - name: blocks_repack_bits_bb_0
- id: blocks_repack_bits_bb
- parameters:
- affinity: ''
- alias: ''
- align_output: 'False'
- comment: ''
- endianness: gr.GR_MSB_FIRST
- k: '8'
- l: '1'
- len_tag_key: len_key
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [792, 236.0]
- rotation: 0
- state: enabled
- - name: blocks_repack_bits_bb_1
- id: blocks_repack_bits_bb
- parameters:
- affinity: ''
- alias: ''
- align_output: 'False'
- comment: ''
- endianness: gr.GR_MSB_FIRST
- k: '1'
- l: '8'
- len_tag_key: '"packet_len"'
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [648, 436.0]
- rotation: 0
- state: true
- - name: blocks_tagged_stream_mux_0
- id: blocks_tagged_stream_mux
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- lengthtagname: packet_len
- maxoutbuf: '0'
- minoutbuf: '0'
- ninputs: '2'
- tag_preserve_head_pos: '0'
- type: byte
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [552, 232.0]
- rotation: 0
- state: true
- - name: blocks_throttle_0
- id: blocks_throttle
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- ignoretag: 'True'
- maxoutbuf: '0'
- minoutbuf: '0'
- samples_per_second: samp_rate
- type: byte
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [992, 244.0]
- rotation: 0
- state: true
- - name: digital_crc32_async_bb_0
- id: digital_crc32_async_bb
- parameters:
- affinity: ''
- alias: ''
- check: 'True'
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [688, 524.0]
- rotation: 0
- state: enabled
- - name: digital_crc32_async_bb_1
- id: digital_crc32_async_bb
- parameters:
- affinity: ''
- alias: ''
- check: 'False'
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [360, 148.0]
- rotation: 180
- state: enabled
- - name: digital_header_payload_demux_0
- id: digital_header_payload_demux
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- guard_interval: '0'
- header_len: '32'
- header_padding: '0'
- items_per_symbol: '1'
- length_tag_key: '"packet_len"'
- maxoutbuf: '0'
- minoutbuf: '0'
- output_symbols: 'False'
- samp_rate: int(samp_rate)
- special_tags: ()
- timing_tag_key: ''
- trigger_tag_key: '"packet_len"'
- type: byte
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [264, 364.0]
- rotation: 0
- state: true
- - name: digital_protocol_formatter_async_0
- id: digital_protocol_formatter_async
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- format: hdr_format
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [112, 136.0]
- rotation: 180
- state: enabled
- - name: digital_protocol_parser_b_0
- id: digital_protocol_parser_b
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- format: hdr_format
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [328, 548.0]
- rotation: 180
- state: enabled
- - name: epy_block_0
- id: epy_block
- parameters:
- _source_code: "\"\"\"\nEmbedded Python Block\n\"\"\"\n\nimport numpy as np\nfrom\
- \ gnuradio import gr\nimport pmt\n\nclass blk(gr.sync_block): # other base\
- \ classes are basic_block, decim_block, interp_block\n \"\"\"Embedded Python\
- \ Block\"\"\"\n\n def __init__(self):\n gr.sync_block.__init__(self,\n\
- \ name = \"PMT to PDU\",\n in_sig = None,\n \
- \ out_sig = None)\n self.message_port_register_in(pmt.intern('PMT_in'))\n\
- \ self.message_port_register_out(pmt.intern('PDU_out'))\n self.set_msg_handler(pmt.intern('PMT_in'),\
- \ self.handle_msg)\n\n def handle_msg(self, msg):\n global textboxValue\n\
- \ textboxValue = pmt.symbol_to_string (msg)\n # print (textboxValue)\n\
- \ mLen = len (textboxValue)\n # print (mLen)\n char_list\
- \ = []\n if (mLen > 0):\n for in0 in textboxValue:\n \
- \ # get next char\n inChar = str (in0)\n \
- \ char_list.append (ord(inChar))\n # print (char_list)\n \
- \ self.message_port_pub(pmt.intern('PDU_out'), pmt.cons(pmt.PMT_NIL,pmt.init_u8vector(mLen,(char_list))))\n"
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- _io_cache: ('PMT to PDU', 'blk', [], [('PMT_in', 'message', 1)], [('PDU_out',
- 'message', 1)], 'Embedded Python Block', [])
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [584, 152.0]
- rotation: 180
- state: true
- - name: epy_block_1
- id: epy_block
- parameters:
- _source_code: "\"\"\"\nEmbedded Python Block\n\"\"\"\n\nimport numpy as np\nfrom\
- \ gnuradio import gr\nimport pmt\n\nclass blk(gr.sync_block): # other base\
- \ classes are basic_block, decim_block, interp_block\n \"\"\"Embedded Python\
- \ Block\"\"\"\n\n def __init__(self):\n gr.sync_block.__init__(self,\n\
- \ name = \"PDU to PMT\",\n in_sig = None,\n \
- \ out_sig = None)\n self.message_port_register_in(pmt.intern('PDU in'))\n\
- \ self.message_port_register_out(pmt.intern('PMT out'))\n self.set_msg_handler(pmt.intern('PDU\
- \ in'), self.handle_msg)\n\n def handle_msg(self, msg):\n # decode\
- \ PDU msg\n pdu_msg = pmt.to_python (pmt.cdr (msg))\n # print\
- \ (pdu_msg)\n pLen = len (pdu_msg)\n # print (mLen)\n outLine\
- \ = []\n k = 0;\n while (k < pLen):\n # print (pdu_msg[k])\n\
- \ outLine.append (chr(pdu_msg[k]))\n k += 1\n #\
- \ print (outLine)\n dispLine = \"\".join (outLine)\n # print (dispLine)\n\
- \ self.message_port_pub (pmt.intern('PMT out'), pmt.intern (dispLine))\n"
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- states:
- _io_cache: ('PDU to PMT', 'blk', [], [('PDU in', 'message', 1)], [('PMT out',
- 'message', 1)], 'Embedded Python Block', [])
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [888, 528.0]
- rotation: 0
- state: true
- - name: pdu_pdu_to_tagged_stream_0
- id: pdu_pdu_to_tagged_stream
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- tag: len_key
- type: byte
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [304, 228.0]
- rotation: 0
- state: enabled
- - name: pdu_pdu_to_tagged_stream_2
- id: pdu_pdu_to_tagged_stream
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- tag: packet_len
- type: byte
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [304, 284.0]
- rotation: 0
- state: true
- - name: pdu_tagged_stream_to_pdu_0
- id: pdu_tagged_stream_to_pdu
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- tag: packet_len
- type: byte
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [856, 444.0]
- rotation: 0
- state: true
- - name: virtual_sink_1
- id: virtual_sink
- parameters:
- alias: ''
- comment: ''
- stream_id: pkt_out
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1136, 316.0]
- rotation: 0
- state: true
- - name: virtual_source_1
- id: virtual_source
- parameters:
- alias: ''
- comment: ''
- stream_id: pkt_out
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [24, 396.0]
- rotation: 0
- state: true
- - name: zeromq_pull_msg_source_0
- id: zeromq_pull_msg_source
- parameters:
- address: tcp://127.0.0.1:50251
- affinity: ''
- alias: ''
- bind: 'False'
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- timeout: '100'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [784, 140.0]
- rotation: 180
- state: true
- - name: zeromq_push_msg_sink_0
- id: zeromq_push_msg_sink
- parameters:
- address: tcp://127.0.0.1:50252
- affinity: ''
- alias: ''
- bind: 'True'
- comment: ''
- timeout: '100'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [1072, 516.0]
- rotation: 0
- state: true
- connections:
- - [blocks_repack_bits_bb_0, '0', blocks_throttle_0, '0']
- - [blocks_repack_bits_bb_1, '0', pdu_tagged_stream_to_pdu_0, '0']
- - [blocks_tagged_stream_mux_0, '0', blocks_repack_bits_bb_0, '0']
- - [blocks_throttle_0, '0', virtual_sink_1, '0']
- - [digital_crc32_async_bb_0, out, epy_block_1, PDU in]
- - [digital_crc32_async_bb_1, out, digital_protocol_formatter_async_0, in]
- - [digital_header_payload_demux_0, '0', digital_protocol_parser_b_0, '0']
- - [digital_header_payload_demux_0, '1', blocks_repack_bits_bb_1, '0']
- - [digital_protocol_formatter_async_0, header, blocks_message_debug_0, print]
- - [digital_protocol_formatter_async_0, header, pdu_pdu_to_tagged_stream_0, pdus]
- - [digital_protocol_formatter_async_0, payload, blocks_message_debug_0, print]
- - [digital_protocol_formatter_async_0, payload, pdu_pdu_to_tagged_stream_2, pdus]
- - [digital_protocol_parser_b_0, info, digital_header_payload_demux_0, header_data]
- - [epy_block_0, PDU_out, digital_crc32_async_bb_1, in]
- - [epy_block_1, PMT out, zeromq_push_msg_sink_0, in]
- - [pdu_pdu_to_tagged_stream_0, '0', blocks_tagged_stream_mux_0, '0']
- - [pdu_pdu_to_tagged_stream_2, '0', blocks_tagged_stream_mux_0, '1']
- - [pdu_tagged_stream_to_pdu_0, pdus, digital_crc32_async_bb_0, in]
- - [virtual_source_1, '0', digital_header_payload_demux_0, '0']
- - [zeromq_pull_msg_source_0, out, epy_block_0, PMT_in]
- metadata:
- file_format: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement