diff options
author | Nao Pross <np@0hm.ch> | 2021-11-21 10:40:53 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-11-21 10:40:53 +0100 |
commit | 2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5 (patch) | |
tree | f45e5b6f5ec5a88456d94abc0a63173f355d2571 /src/gr-fadingui/python/deframer.py | |
parent | Change chapter title (diff) | |
parent | Merge branch 'master' of github.com:NaoPross/Fading (diff) | |
download | Fading-2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5.tar.gz Fading-2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5.zip |
Merge branch 'master' of github.com:NaoPross/Fading
Diffstat (limited to 'src/gr-fadingui/python/deframer.py')
-rw-r--r-- | src/gr-fadingui/python/deframer.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gr-fadingui/python/deframer.py b/src/gr-fadingui/python/deframer.py new file mode 100644 index 0000000..2af5ee0 --- /dev/null +++ b/src/gr-fadingui/python/deframer.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2021 Naoki Pross. + +import numpy as np +from gnuradio import gr + +class deframer(gr.sync_block): + """ + Check for integrity and remove frame header from packet. + """ + def __init__(self, frame_obj): + gr.sync_block.__init__(self, + name="deframer", + in_sig=[np.byte], + out_sig=[np.byte]) + + + def work(self, input_items, output_items): + in0 = input_items[0] + out = output_items[0] + + out[:] = in0 + return len(output_items[0]) + |