blob: 2ee37fac5dec86ddeabe6af955ed25d695725524 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import numpy as np
from gnuradio import gr
# remove print for now
# print = lambda x: None
np.set_printoptions(formatter={'int':hex})
class blk(gr.sync_block):
def __init__(self, vlen=8):
gr.sync_block.__init__(
self,
name='Printer',
in_sig=[(np.byte, vlen)],
out_sig=[]
)
def work(self, input_items, output_items):
inp = np.array(input_items[0], dtype=np.uint8)
print(f"Decoded {len(inp)} samples:\n{inp}")
return len(inp)
|