@@ -84,7 +84,7 @@ blocks:
84
84
bus_sink: false
85
85
bus_source: false
86
86
bus_structure: null
87
- coordinate: [152 , 332.0]
87
+ coordinate: [232 , 332.0]
88
88
rotation: 0
89
89
state: enabled
90
90
- name: samp_rate
@@ -96,7 +96,7 @@ blocks:
96
96
bus_sink: false
97
97
bus_source: false
98
98
bus_structure: null
99
- coordinate: [8, 76 ]
99
+ coordinate: [8, 140.0 ]
100
100
rotation: 0
101
101
state: enabled
102
102
- name: threshold
@@ -124,7 +124,7 @@ blocks:
124
124
bus_sink: false
125
125
bus_source: false
126
126
bus_structure: null
127
- coordinate: [856 , 184.0]
127
+ coordinate: [936 , 184.0]
128
128
rotation: 0
129
129
state: enabled
130
130
- name: blocks_rotator_cc_0
@@ -141,7 +141,7 @@ blocks:
141
141
bus_sink: false
142
142
bus_source: false
143
143
bus_structure: null
144
- coordinate: [432 , 168.0]
144
+ coordinate: [512 , 168.0]
145
145
rotation: 0
146
146
state: enabled
147
147
- name: import_0
@@ -154,7 +154,7 @@ blocks:
154
154
bus_sink: false
155
155
bus_source: false
156
156
bus_structure: null
157
- coordinate: [8, 404 ]
157
+ coordinate: [8, 76.0 ]
158
158
rotation: 0
159
159
state: enabled
160
160
- name: osmosdr_source_0
@@ -511,7 +511,7 @@ blocks:
511
511
bus_sink: false
512
512
bus_source: false
513
513
bus_structure: null
514
- coordinate: [136 , 76.0]
514
+ coordinate: [216 , 76.0]
515
515
rotation: 0
516
516
state: enabled
517
517
- name: qtgui_time_sink_x_0
@@ -608,7 +608,7 @@ blocks:
608
608
bus_sink: false
609
609
bus_source: false
610
610
bus_structure: null
611
- coordinate: [576 , 420.0]
611
+ coordinate: [656 , 420.0]
612
612
rotation: 180
613
613
state: enabled
614
614
- name: rational_resampler_xxx_0
@@ -628,7 +628,7 @@ blocks:
628
628
bus_sink: false
629
629
bus_source: false
630
630
bus_structure: null
631
- coordinate: [664 , 156.0]
631
+ coordinate: [744 , 156.0]
632
632
rotation: 0
633
633
state: enabled
634
634
- name: rational_resampler_xxx_1
@@ -648,7 +648,7 @@ blocks:
648
648
bus_sink: false
649
649
bus_source: false
650
650
bus_structure: null
651
- coordinate: [792 , 332.0]
651
+ coordinate: [872 , 332.0]
652
652
rotation: 180
653
653
state: enabled
654
654
- name: secplus_decode
@@ -664,10 +664,10 @@ blocks:
664
664
\ See the\n# GNU General Public License for more details.\n#\n# You should\
665
665
\ have received a copy of the GNU General Public License\n# along with secplus.\
666
666
\ If not, see <http://www.gnu.org/licenses/>.\n#\n\nimport numpy as np\nfrom\
667
- \ gnuradio import gr\nimport secplus\n\n\nclass blk(gr.sync_block) :\n \"\" \
668
- \"Decoder for Chamberlain garage door openers \"\"\"\n\n def __init__(self, \
669
- \ samp_rate=10000, threshold=0.02):\n gr.sync_block.__init__(\n \
670
- \ self,\n name='Security+ Decoder',\n\n in_sig=[np.float32],\n\
667
+ \ gnuradio import gr\ntry:\n import secplus\nexcept :\n pass\n\n\nclass \
668
+ \ blk(gr.sync_block):\n \"\"\"Decoder for Chamberlain garage door openers\" \
669
+ \"\"\n\n def __init__(self, samp_rate=10000, threshold=0.02):\n gr.sync_block.__init__(\n\
670
+ \ self,\n name='Security+ Decoder',\n\n in_sig=[np.float32],\n\
671
671
\ out_sig=[]\n )\n self.samp_rate = samp_rate\n \
672
672
\ self.threshold = threshold\n self.last_sample = 0.0\n self.last_rise\
673
673
\ = 0\n self.buffer = []\n self.last_pair = []\n self.pair\
@@ -707,7 +707,7 @@ blocks:
707
707
bus_sink: false
708
708
bus_source: false
709
709
bus_structure: null
710
- coordinate: [576 , 276.0]
710
+ coordinate: [656 , 276.0]
711
711
rotation: 180
712
712
state: enabled
713
713
- name: secplus_v2_decode
@@ -723,23 +723,23 @@ blocks:
723
723
\ See the\n# GNU General Public License for more details.\n#\n# You should\
724
724
\ have received a copy of the GNU General Public License\n# along with secplus.\
725
725
\ If not, see <http://www.gnu.org/licenses/>.\n#\n\nimport numpy as np\nfrom\
726
- \ gnuradio import gr\nimport secplus\n\n\nclass blk(gr.sync_block):\n \"\"\
727
- \"Decoder for Chamberlain garage door openers\"\"\"\n\n def __init__(self,\
728
- \ samp_rate=10000, threshold=0.02):\n gr.sync_block.__init__(\n \
729
- \ self,\n name='Security+ 2.0 Decoder',\n\n in_sig=[np.float32],\n\
730
- \ out_sig=[]\n )\n self.samp_rate = samp_rate\n \
731
- \ self.threshold = threshold\n self.last_sample = 0.0\n self.last_edge\
732
- \ = 0\n self.buffer = []\n self.pair = [None, None]\n self.pair_time\
733
- \ = [None, None]\n\n def work(self, input_items, output_items):\n \
734
- \ for n, sample in enumerate(input_items[0]):\n current_sample =\
735
- \ self.nitems_read(0) + n\n if self.last_sample < self.threshold\
736
- \ <= sample:\n # rising edge\n self.process_edge(True,\
726
+ \ gnuradio import gr\ntry:\n import secplus\nexcept:\n pass\n\n\nclass\
727
+ \ blk(gr.sync_block):\n \"\"\"Decoder for Chamberlain garage door openers\"\
728
+ \"\"\n\n def __init__(self, samp_rate=10000, threshold=0.02):\n gr.sync_block.__init__(\n\
729
+ \ self,\n name='Security+ 2.0 Decoder',\n\n \
730
+ \ in_sig=[np.float32],\n out_sig=[]\n )\n self.samp_rate\
731
+ \ = samp_rate\n self.threshold = threshold\n self.last_sample\
732
+ \ = 0.0\n self.last_edge = 0\n self.buffer = []\n self.pair\
733
+ \ = [None, None]\n self.pair_time = [None, None]\n\n def work(self,\
734
+ \ input_items, output_items):\n for n, sample in enumerate(input_items[0]):\n\
735
+ \ current_sample = self.nitems_read(0) + n\n if self.last_sample\
736
+ \ < self.threshold <= sample:\n # rising edge\n \
737
+ \ self.process_edge(True, current_sample - self.last_edge)\n \
738
+ \ self.last_edge = current_sample\n elif self.last_sample >= self.threshold\
739
+ \ > sample:\n # falling edge\n self.process_edge(False,\
737
740
\ current_sample - self.last_edge)\n self.last_edge = current_sample\n\
738
- \ elif self.last_sample >= self.threshold > sample:\n \
739
- \ # falling edge\n self.process_edge(False, current_sample\
740
- \ - self.last_edge)\n self.last_edge = current_sample\n \
741
- \ if current_sample - self.last_edge >= 0.625e-3 * self.samp_rate:\n \
742
- \ self.buffer.append(0)\n self.buffer.append(0)\n\
741
+ \ if current_sample - self.last_edge >= 0.625e-3 * self.samp_rate:\n\
742
+ \ self.buffer.append(0)\n self.buffer.append(0)\n\
743
743
\ self.process_buffer(current_sample)\n self.buffer\
744
744
\ = []\n self.last_sample = sample\n return len(input_items[0])\n\
745
745
\n def process_edge(self, rising, samples):\n if samples < 0.125e-3\
@@ -781,7 +781,7 @@ blocks:
781
781
bus_sink: false
782
782
bus_source: false
783
783
bus_structure: null
784
- coordinate: [560 , 348.0]
784
+ coordinate: [640 , 348.0]
785
785
rotation: 180
786
786
state: enabled
787
787
0 commit comments