From e31ab6591197d75b6bfbda00e20cbcf3401675a9 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sat, 4 Jul 2015 00:39:34 +0200 Subject: [PATCH] Issue #44 --- includes/decoders/poc.py | 4 ++-- testdata/testdata.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index 7462af5..add42a1 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -101,7 +101,7 @@ def decode(freq, decoded): else: poc_text = "" - if re.search("[0-9]{7}", poc_id): #if POC is valid + if re.search("[0-9]{7}", poc_id) and re.search("[0-3]{1}", poc_sub): #if POC is valid if isAllowed(poc_id): # check for double alarm if doubleFilter.checkID("POC", poc_id+poc_sub, poc_text): @@ -126,4 +126,4 @@ def decode(freq, decoded): else: logging.debug("POCSAG%s: %s is not allowed", bitrate, poc_id) else: - logging.warning("No valid POCSAG%s RIC: %s", bitrate, poc_id) + logging.warning("No valid POCSAG%s RIC: %s SUB: %s", bitrate, poc_id, poc_sub) diff --git a/testdata/testdata.txt b/testdata/testdata.txt index 0c9f1a8..acd6c88 100644 --- a/testdata/testdata.txt +++ b/testdata/testdata.txt @@ -73,7 +73,7 @@ POCSAG512: Address: 333333 Function: 0 Alpha: BOSWatch-Test: okay POCSAG512: Address: 3333333 Function: 0 Alpha: BOSWatch-Test: okay POCSAG512: Address: 333333F Function: 0 Alpha: BOSWatch-Test: invalid POCSAG512: Address: 333333F Function: 1 Alpha: BOSWatch-Test: invalid -POCSAG512: Address: 3333333 Function: 4 Alpha: BOSWatch-Test: invalid (issue #38) +POCSAG512: Address: 3333333 Function: 4 Alpha: BOSWatch-Test: invalid # denied POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied