Advertisement
duggabe

pkt_7,grc

Oct 3rd, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.53 KB | None | 0 0
  1. options:
  2. parameters:
  3. author: Barry Duggan
  4. catch_exceptions: 'True'
  5. category: Custom
  6. cmake_opt: ''
  7. comment: ''
  8. copyright: ''
  9. description: Generate and parse CRC header
  10. gen_cmake: 'On'
  11. gen_linking: dynamic
  12. generate_options: qt_gui
  13. hier_block_src_path: '.:'
  14. id: pkt_7
  15. max_nouts: '0'
  16. output_language: python
  17. placement: (0,0)
  18. qt_qss_theme: ''
  19. realtime_scheduling: ''
  20. run: 'True'
  21. run_command: '{python} -u {filename}'
  22. run_options: prompt
  23. sizing_mode: fixed
  24. thread_safe_setters: ''
  25. title: pkt_7
  26. states:
  27. bus_sink: false
  28. bus_source: false
  29. bus_structure: null
  30. coordinate: [16, 12.0]
  31. rotation: 0
  32. state: enabled
  33.  
  34. blocks:
  35. - name: hdr_format
  36. id: variable
  37. parameters:
  38. comment: ''
  39. value: digital.header_format_crc(len_key, num_key)
  40. states:
  41. bus_sink: false
  42. bus_source: false
  43. bus_structure: null
  44. coordinate: [512, 12.0]
  45. rotation: 0
  46. state: enabled
  47. - name: len_key
  48. id: variable
  49. parameters:
  50. comment: ''
  51. value: '"packet_len"'
  52. states:
  53. bus_sink: false
  54. bus_source: false
  55. bus_structure: null
  56. coordinate: [280, 12.0]
  57. rotation: 0
  58. state: enabled
  59. - name: num_key
  60. id: variable
  61. parameters:
  62. comment: ''
  63. value: '"packet_num"'
  64. states:
  65. bus_sink: false
  66. bus_source: false
  67. bus_structure: null
  68. coordinate: [392, 12.0]
  69. rotation: 0
  70. state: enabled
  71. - name: samp_rate
  72. id: variable
  73. parameters:
  74. comment: ''
  75. value: 32e3
  76. states:
  77. bus_sink: false
  78. bus_source: false
  79. bus_structure: null
  80. coordinate: [192, 12.0]
  81. rotation: 0
  82. state: true
  83. - name: blocks_message_debug_0
  84. id: blocks_message_debug
  85. parameters:
  86. affinity: ''
  87. alias: ''
  88. comment: ''
  89. en_uvec: 'True'
  90. states:
  91. bus_sink: false
  92. bus_source: false
  93. bus_structure: null
  94. coordinate: [112, 232.0]
  95. rotation: 0
  96. state: enabled
  97. - name: blocks_repack_bits_bb_0
  98. id: blocks_repack_bits_bb
  99. parameters:
  100. affinity: ''
  101. alias: ''
  102. align_output: 'False'
  103. comment: ''
  104. endianness: gr.GR_MSB_FIRST
  105. k: '8'
  106. l: '1'
  107. len_tag_key: len_key
  108. maxoutbuf: '0'
  109. minoutbuf: '0'
  110. states:
  111. bus_sink: false
  112. bus_source: false
  113. bus_structure: null
  114. coordinate: [792, 236.0]
  115. rotation: 0
  116. state: enabled
  117. - name: blocks_repack_bits_bb_1
  118. id: blocks_repack_bits_bb
  119. parameters:
  120. affinity: ''
  121. alias: ''
  122. align_output: 'False'
  123. comment: ''
  124. endianness: gr.GR_MSB_FIRST
  125. k: '1'
  126. l: '8'
  127. len_tag_key: '"packet_len"'
  128. maxoutbuf: '0'
  129. minoutbuf: '0'
  130. states:
  131. bus_sink: false
  132. bus_source: false
  133. bus_structure: null
  134. coordinate: [648, 436.0]
  135. rotation: 0
  136. state: true
  137. - name: blocks_tagged_stream_mux_0
  138. id: blocks_tagged_stream_mux
  139. parameters:
  140. affinity: ''
  141. alias: ''
  142. comment: ''
  143. lengthtagname: packet_len
  144. maxoutbuf: '0'
  145. minoutbuf: '0'
  146. ninputs: '2'
  147. tag_preserve_head_pos: '0'
  148. type: byte
  149. vlen: '1'
  150. states:
  151. bus_sink: false
  152. bus_source: false
  153. bus_structure: null
  154. coordinate: [552, 232.0]
  155. rotation: 0
  156. state: true
  157. - name: blocks_throttle_0
  158. id: blocks_throttle
  159. parameters:
  160. affinity: ''
  161. alias: ''
  162. comment: ''
  163. ignoretag: 'True'
  164. maxoutbuf: '0'
  165. minoutbuf: '0'
  166. samples_per_second: samp_rate
  167. type: byte
  168. vlen: '1'
  169. states:
  170. bus_sink: false
  171. bus_source: false
  172. bus_structure: null
  173. coordinate: [992, 244.0]
  174. rotation: 0
  175. state: true
  176. - name: digital_crc32_async_bb_0
  177. id: digital_crc32_async_bb
  178. parameters:
  179. affinity: ''
  180. alias: ''
  181. check: 'True'
  182. comment: ''
  183. maxoutbuf: '0'
  184. minoutbuf: '0'
  185. states:
  186. bus_sink: false
  187. bus_source: false
  188. bus_structure: null
  189. coordinate: [688, 524.0]
  190. rotation: 0
  191. state: enabled
  192. - name: digital_crc32_async_bb_1
  193. id: digital_crc32_async_bb
  194. parameters:
  195. affinity: ''
  196. alias: ''
  197. check: 'False'
  198. comment: ''
  199. maxoutbuf: '0'
  200. minoutbuf: '0'
  201. states:
  202. bus_sink: false
  203. bus_source: false
  204. bus_structure: null
  205. coordinate: [360, 148.0]
  206. rotation: 180
  207. state: enabled
  208. - name: digital_header_payload_demux_0
  209. id: digital_header_payload_demux
  210. parameters:
  211. affinity: ''
  212. alias: ''
  213. comment: ''
  214. guard_interval: '0'
  215. header_len: '32'
  216. header_padding: '0'
  217. items_per_symbol: '1'
  218. length_tag_key: '"packet_len"'
  219. maxoutbuf: '0'
  220. minoutbuf: '0'
  221. output_symbols: 'False'
  222. samp_rate: int(samp_rate)
  223. special_tags: ()
  224. timing_tag_key: ''
  225. trigger_tag_key: '"packet_len"'
  226. type: byte
  227. states:
  228. bus_sink: false
  229. bus_source: false
  230. bus_structure: null
  231. coordinate: [264, 364.0]
  232. rotation: 0
  233. state: true
  234. - name: digital_protocol_formatter_async_0
  235. id: digital_protocol_formatter_async
  236. parameters:
  237. affinity: ''
  238. alias: ''
  239. comment: ''
  240. format: hdr_format
  241. maxoutbuf: '0'
  242. minoutbuf: '0'
  243. states:
  244. bus_sink: false
  245. bus_source: false
  246. bus_structure: null
  247. coordinate: [112, 136.0]
  248. rotation: 180
  249. state: enabled
  250. - name: digital_protocol_parser_b_0
  251. id: digital_protocol_parser_b
  252. parameters:
  253. affinity: ''
  254. alias: ''
  255. comment: ''
  256. format: hdr_format
  257. maxoutbuf: '0'
  258. minoutbuf: '0'
  259. states:
  260. bus_sink: false
  261. bus_source: false
  262. bus_structure: null
  263. coordinate: [328, 548.0]
  264. rotation: 180
  265. state: enabled
  266. - name: epy_block_0
  267. id: epy_block
  268. parameters:
  269. _source_code: "\"\"\"\nEmbedded Python Block\n\"\"\"\n\nimport numpy as np\nfrom\
  270. \ gnuradio import gr\nimport pmt\n\nclass blk(gr.sync_block): # other base\
  271. \ classes are basic_block, decim_block, interp_block\n \"\"\"Embedded Python\
  272. \ Block\"\"\"\n\n def __init__(self):\n gr.sync_block.__init__(self,\n\
  273. \ name = \"PMT to PDU\",\n in_sig = None,\n \
  274. \ out_sig = None)\n self.message_port_register_in(pmt.intern('PMT_in'))\n\
  275. \ self.message_port_register_out(pmt.intern('PDU_out'))\n self.set_msg_handler(pmt.intern('PMT_in'),\
  276. \ self.handle_msg)\n\n def handle_msg(self, msg):\n global textboxValue\n\
  277. \ textboxValue = pmt.symbol_to_string (msg)\n # print (textboxValue)\n\
  278. \ mLen = len (textboxValue)\n # print (mLen)\n char_list\
  279. \ = []\n if (mLen > 0):\n for in0 in textboxValue:\n \
  280. \ # get next char\n inChar = str (in0)\n \
  281. \ char_list.append (ord(inChar))\n # print (char_list)\n \
  282. \ self.message_port_pub(pmt.intern('PDU_out'), pmt.cons(pmt.PMT_NIL,pmt.init_u8vector(mLen,(char_list))))\n"
  283. affinity: ''
  284. alias: ''
  285. comment: ''
  286. maxoutbuf: '0'
  287. minoutbuf: '0'
  288. states:
  289. _io_cache: ('PMT to PDU', 'blk', [], [('PMT_in', 'message', 1)], [('PDU_out',
  290. 'message', 1)], 'Embedded Python Block', [])
  291. bus_sink: false
  292. bus_source: false
  293. bus_structure: null
  294. coordinate: [584, 152.0]
  295. rotation: 180
  296. state: true
  297. - name: epy_block_1
  298. id: epy_block
  299. parameters:
  300. _source_code: "\"\"\"\nEmbedded Python Block\n\"\"\"\n\nimport numpy as np\nfrom\
  301. \ gnuradio import gr\nimport pmt\n\nclass blk(gr.sync_block): # other base\
  302. \ classes are basic_block, decim_block, interp_block\n \"\"\"Embedded Python\
  303. \ Block\"\"\"\n\n def __init__(self):\n gr.sync_block.__init__(self,\n\
  304. \ name = \"PDU to PMT\",\n in_sig = None,\n \
  305. \ out_sig = None)\n self.message_port_register_in(pmt.intern('PDU in'))\n\
  306. \ self.message_port_register_out(pmt.intern('PMT out'))\n self.set_msg_handler(pmt.intern('PDU\
  307. \ in'), self.handle_msg)\n\n def handle_msg(self, msg):\n # decode\
  308. \ PDU msg\n pdu_msg = pmt.to_python (pmt.cdr (msg))\n # print\
  309. \ (pdu_msg)\n pLen = len (pdu_msg)\n # print (mLen)\n outLine\
  310. \ = []\n k = 0;\n while (k < pLen):\n # print (pdu_msg[k])\n\
  311. \ outLine.append (chr(pdu_msg[k]))\n k += 1\n #\
  312. \ print (outLine)\n dispLine = \"\".join (outLine)\n # print (dispLine)\n\
  313. \ self.message_port_pub (pmt.intern('PMT out'), pmt.intern (dispLine))\n"
  314. affinity: ''
  315. alias: ''
  316. comment: ''
  317. maxoutbuf: '0'
  318. minoutbuf: '0'
  319. states:
  320. _io_cache: ('PDU to PMT', 'blk', [], [('PDU in', 'message', 1)], [('PMT out',
  321. 'message', 1)], 'Embedded Python Block', [])
  322. bus_sink: false
  323. bus_source: false
  324. bus_structure: null
  325. coordinate: [888, 528.0]
  326. rotation: 0
  327. state: true
  328. - name: pdu_pdu_to_tagged_stream_0
  329. id: pdu_pdu_to_tagged_stream
  330. parameters:
  331. affinity: ''
  332. alias: ''
  333. comment: ''
  334. maxoutbuf: '0'
  335. minoutbuf: '0'
  336. tag: len_key
  337. type: byte
  338. states:
  339. bus_sink: false
  340. bus_source: false
  341. bus_structure: null
  342. coordinate: [304, 228.0]
  343. rotation: 0
  344. state: enabled
  345. - name: pdu_pdu_to_tagged_stream_2
  346. id: pdu_pdu_to_tagged_stream
  347. parameters:
  348. affinity: ''
  349. alias: ''
  350. comment: ''
  351. maxoutbuf: '0'
  352. minoutbuf: '0'
  353. tag: packet_len
  354. type: byte
  355. states:
  356. bus_sink: false
  357. bus_source: false
  358. bus_structure: null
  359. coordinate: [304, 284.0]
  360. rotation: 0
  361. state: true
  362. - name: pdu_tagged_stream_to_pdu_0
  363. id: pdu_tagged_stream_to_pdu
  364. parameters:
  365. affinity: ''
  366. alias: ''
  367. comment: ''
  368. maxoutbuf: '0'
  369. minoutbuf: '0'
  370. tag: packet_len
  371. type: byte
  372. states:
  373. bus_sink: false
  374. bus_source: false
  375. bus_structure: null
  376. coordinate: [856, 444.0]
  377. rotation: 0
  378. state: true
  379. - name: virtual_sink_1
  380. id: virtual_sink
  381. parameters:
  382. alias: ''
  383. comment: ''
  384. stream_id: pkt_out
  385. states:
  386. bus_sink: false
  387. bus_source: false
  388. bus_structure: null
  389. coordinate: [1136, 316.0]
  390. rotation: 0
  391. state: true
  392. - name: virtual_source_1
  393. id: virtual_source
  394. parameters:
  395. alias: ''
  396. comment: ''
  397. stream_id: pkt_out
  398. states:
  399. bus_sink: false
  400. bus_source: false
  401. bus_structure: null
  402. coordinate: [24, 396.0]
  403. rotation: 0
  404. state: true
  405. - name: zeromq_pull_msg_source_0
  406. id: zeromq_pull_msg_source
  407. parameters:
  408. address: tcp://127.0.0.1:50251
  409. affinity: ''
  410. alias: ''
  411. bind: 'False'
  412. comment: ''
  413. maxoutbuf: '0'
  414. minoutbuf: '0'
  415. timeout: '100'
  416. states:
  417. bus_sink: false
  418. bus_source: false
  419. bus_structure: null
  420. coordinate: [784, 140.0]
  421. rotation: 180
  422. state: true
  423. - name: zeromq_push_msg_sink_0
  424. id: zeromq_push_msg_sink
  425. parameters:
  426. address: tcp://127.0.0.1:50252
  427. affinity: ''
  428. alias: ''
  429. bind: 'True'
  430. comment: ''
  431. timeout: '100'
  432. states:
  433. bus_sink: false
  434. bus_source: false
  435. bus_structure: null
  436. coordinate: [1072, 516.0]
  437. rotation: 0
  438. state: true
  439.  
  440. connections:
  441. - [blocks_repack_bits_bb_0, '0', blocks_throttle_0, '0']
  442. - [blocks_repack_bits_bb_1, '0', pdu_tagged_stream_to_pdu_0, '0']
  443. - [blocks_tagged_stream_mux_0, '0', blocks_repack_bits_bb_0, '0']
  444. - [blocks_throttle_0, '0', virtual_sink_1, '0']
  445. - [digital_crc32_async_bb_0, out, epy_block_1, PDU in]
  446. - [digital_crc32_async_bb_1, out, digital_protocol_formatter_async_0, in]
  447. - [digital_header_payload_demux_0, '0', digital_protocol_parser_b_0, '0']
  448. - [digital_header_payload_demux_0, '1', blocks_repack_bits_bb_1, '0']
  449. - [digital_protocol_formatter_async_0, header, blocks_message_debug_0, print]
  450. - [digital_protocol_formatter_async_0, header, pdu_pdu_to_tagged_stream_0, pdus]
  451. - [digital_protocol_formatter_async_0, payload, blocks_message_debug_0, print]
  452. - [digital_protocol_formatter_async_0, payload, pdu_pdu_to_tagged_stream_2, pdus]
  453. - [digital_protocol_parser_b_0, info, digital_header_payload_demux_0, header_data]
  454. - [epy_block_0, PDU_out, digital_crc32_async_bb_1, in]
  455. - [epy_block_1, PMT out, zeromq_push_msg_sink_0, in]
  456. - [pdu_pdu_to_tagged_stream_0, '0', blocks_tagged_stream_mux_0, '0']
  457. - [pdu_pdu_to_tagged_stream_2, '0', blocks_tagged_stream_mux_0, '1']
  458. - [pdu_tagged_stream_to_pdu_0, pdus, digital_crc32_async_bb_0, in]
  459. - [virtual_source_1, '0', digital_header_payload_demux_0, '0']
  460. - [zeromq_pull_msg_source_0, out, epy_block_0, PMT_in]
  461.  
  462. metadata:
  463. file_format: 1
  464.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement