aboutsummaryrefslogtreecommitdiffstats
path: root/src/gr-fadingui/python/xor_frame_sync.py
blob: 9d9064f1e2d7ed86d7cc53f7fa5eb3cf3472f245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2021 Naoki Pross.


import numpy
from gnuradio import gr

class xor_frame_sync(gr.sync_block):
    """
    docstring for block xor_frame_sync
    """
    def __init__(self, sync_pattern):
        gr.sync_block.__init__(self,
            name="xor_frame_sync",
            in_sig=[np.byte],
            out_sig=[np.byte])

    def work(self, input_items, output_items):
        inp = input_items[0]
        out = output_items[0]

        out[:] = inp

        return len(output_items[0])