From d8fb6295d8f6bea9f7a1bd4da4853d455143d63e Mon Sep 17 00:00:00 2001 From: Thierry Fredrich Date: Tue, 15 Jun 2021 16:06:26 +0200 Subject: [PATCH 1/4] implemented multicast alarms --- config/server.yaml | 74 ++++++----- module/multicast.py | 133 ++++++++++++++++++++ test/testdata.list | 291 +++++++++++++++++++++++--------------------- 3 files changed, 332 insertions(+), 166 deletions(-) create mode 100644 module/multicast.py diff --git a/config/server.yaml b/config/server.yaml index 03e260d..99eab86 100644 --- a/config/server.yaml +++ b/config/server.yaml @@ -1,30 +1,44 @@ -# -*- coding: utf-8 -*- -# ____ ____ ______ __ __ __ _____ -# / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ / -# / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ < -# / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ / -#/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/ -# German BOS Information Script -# by Bastian Schroll - -server: - port: 8080 - name: BW3 Server # name of the BW3 Server instance - useBroadcast: no # serve server ip on broadcast request - -alarmRouter: -- Router 1 - -router: -- name: Router 1 - route: - - type: module - res: filter.modeFilter - name: Filter Fms/Zvei - config: - allowed: - - fms - - zvei - - type: plugin - name: test plugin - res: template_plugin +# -*- coding: utf-8 -*- +# ____ ____ ______ __ __ __ _____ +# / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ / +# / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ < +# / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ / +#/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/ +# German BOS Information Script +# by Bastian Schroll + +server: + port: 8080 + name: BW3 Server # name of the BW3 Server instance + useBroadcast: no # serve server ip on broadcast request + +alarmRouter: +- Alarm_multicast + +router: +- name: Alarm_multicast + route: + - type: module + res: filter.regexFilter + config: + - name: "valid multicast rics" + checks: + - field: ric + regex: 210000|210002|210003 + - type: module + res: filter.doubleFilter + name: Filter double + config: + ignoreTime: 10 + maxEntry: 10 + pocsagFields: + - ric + - subric + - type: module + res: multicast + name: Find the multicast message infos + config: + multicastAlarm_textRics: 2100002,210001 + multicastAlarm_ignore_time: 10 + multicastAlarm_delimiterRic: 2100003 + multicastAlarm_delimiterSubric: 0 diff --git a/module/multicast.py b/module/multicast.py new file mode 100644 index 0000000..4b602a7 --- /dev/null +++ b/module/multicast.py @@ -0,0 +1,133 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +"""! + ____ ____ ______ __ __ __ _____ + / __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ / + / __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ < + / /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ / +/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/ + German BOS Information Script + by Bastian Schroll + +@file: multicast.py +@date: 02.05.2021 +@author: Thierry Fredrich +@description: Implements multicast alarms + +structure of a multicast alarm +# 1 ) network delimiter without text +# 2 ) alarm ric without text +# 3 ) text ric with message +# 4 ) network delimiter ric message +""" +import logging +from module.moduleBase import ModuleBase + + +logging.debug("- %s loaded", __name__) + + +class BoswatchModule(ModuleBase): + """!Description of the Module""" + # initializing with empty list + + textRics = [] + delimiterRic = 42 + delimiterSubric = 42 + ignoreTime = 42 + ### to be cleared + receivedAlarmRic = 42 + receivedAlarmSubric = 42 + bufferListFormingAMulticastAlarm = [] + initialDelimiterReceived = False + alarmReceived = False + textRicReceived = False + textRicMessage = '' + def initStorage(self): + self.receivedAlarmRic = 42 + self.receivedAlarmSubric = 42 + self.bufferListFormingAMulticastAlarm = [] + self.initialDelimiterReceived = False + self.alarmReceived = False + self.textRicReceived = False + self.textRicMessage = '' + + def __init__(self, config): + """!Do not change anything here!""" + super().__init__(__name__, config) # you can access the config class on 'self.config' + logging.debug("starting multicast module") + logging.debug("multicastAlarm_delimiterRic is: %i" % self.config.get("multicastAlarm_delimiterRic")) + logging.debug("multicastAlarm_delimiterSubric is: %i" % self.config.get("multicastAlarm_delimiterSubric")) + logging.debug("multicastAlarm_ignore_time is: %i" % self.config.get("multicastAlarm_ignore_time")) + logging.debug("multicastAlarm_textRics is: %s" % self.config.get("multicastAlarm_textRics")) + self.delimiterRic = int(self.config.get("multicastAlarm_delimiterRic")) + self.delimiterSubric = int(self.config.get("multicastAlarm_delimiterSubric")) + self.ignoreTime = int(self.config.get("multicastAlarm_ignore_time")) + for aTextRic in self.config.get("multicastAlarm_textRics").split(','): + self.textRics.append(int(aTextRic)) + self.initStorage() + + def onLoad(self): + """!Called by import of the plugin + Remove if not implemented""" + pass + + def doWork(self, bwPacket): + """!start an run of the module. + + @param bwPacket: A BOSWatch packet instance""" + thisRic = int(bwPacket.get("ric")) + thisSubric = int(bwPacket.get("subric"))-1 + thisMessage = bwPacket.get("message") + if bwPacket.get("mode") == "pocsag": + pass + else: + logging.error("multicast module only works with pocsag") + raise NameError('multicast module only works with pocsag') + + '''delimiter received''' + if self.delimiterRic == thisRic and self.delimiterSubric == thisSubric: + ''' is it the initial delimiter?''' + if not self.initialDelimiterReceived and \ + not self.alarmReceived and \ + not self.textRicReceived: + self.bufferListFormingAMulticastAlarm.append(bwPacket) + self.initialDelimiterReceived = True + return False + ''' is it the closeing delimiter?''' + if self.initialDelimiterReceived and \ + self.alarmReceived and self.textRicReceived: + self.bufferListFormingAMulticastAlarm.append(bwPacket) # deliting list here? + logging.debug("modify bwPacket" ) + bwPacket.set('message',self.textRicMessage) + #bwPacket.update({'message':'bla'}) + logging.debug("multicast completed... clearing storage") + self.initStorage() + return bwPacket + + '''alarm ric recceived''' + if thisRic != self.delimiterRic and thisRic not in self.textRics: + if self.initialDelimiterReceived: + self.bufferListFormingAMulticastAlarm.append(bwPacket) + self.receivedAlarmRic = thisRic + self.receivedAlarmSubric = thisSubric + logging.debug("hoping %i is a valid alarm ric" % thisRic) + logging.debug("with subric %i " % thisSubric) + self.alarmReceived = True + return False + + '''text ric received''' + if thisRic in self.textRics: + if self.initialDelimiterReceived and self.alarmReceived: + self.bufferListFormingAMulticastAlarm.append(bwPacket) + self.textRicReceived = True + self.textRicMessage = thisMessage + logging.debug("multicast text is: %s" % thisMessage ) + return False + return False + + def onUnload(self): + """!Called by destruction of the plugin + Remove if not implemented""" + pass + diff --git a/test/testdata.list b/test/testdata.list index 12b71c0..b985b29 100644 --- a/test/testdata.list +++ b/test/testdata.list @@ -1,136 +1,155 @@ -# Testdata for the BOSWatch Test Mode function -# Data in Multimon-NG Raw Format -# Data is alternately passed to the decoder to simulate an used Radio-Frequency - -# -# POCSAG -# ------ -# -# The following settings in config.ini are expected for POCSAG -# -# [BOSWatch] -# useDescription = 1 -# doubleFilter_ignore_entries = 10 -# doubleFilter_check_msg = 1 -# -# [POC] -# deny_ric = 7777777 -# filter_range_start = 0000005 -# filter_range_end = 8999999 -# idDescribed = 1 -# - -# bitrate -POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay -POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay -POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay - -# function-code -POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay - -# german special sign -POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay -POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay - -# with csv -POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv - -# without csv -POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv -POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv - -# OHNE TEXT???? -POCSAG1200: Address: 1100000 Function: 0 -POCSAG1200: Address: 1100000 Function: 1 -POCSAG1200: Address: 1100000 Function: 2 -POCSAG1200: Address: 1100000 Function: 3 - -# duplicate with same and other msg -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay - -# duplicate in different order -POCSAG1200: Address: 2100000 Function: 2 -POCSAG1200: Address: 2100001 Function: 2 -POCSAG1200: Address: 2100002 Function: 2 -POCSAG1200: Address: 2100000 Function: 2 -POCSAG1200: Address: 2100001 Function: 2 -POCSAG1200: Address: 2100002 Function: 2 -POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate -POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate - -# invalid -POCSAG512: Address: 3 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 33 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 3333 Function: 0 Alpha: BOSWatch-Test: okay -POCSAG512: Address: 33333 Function: 0 Alpha: BOSWatch-Test: okay -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 - -# denied -POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied - -# out of filter Range -POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start -POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end - -#Probealram -POCSAG1200: Address: 0871004 Function: 1 Alpha: Dies ist ein Probealarm! -## Multicast Alarm -POCSAG1200: Address: 0871002 Function: 0 Alpha: -POCSAG1200: Address: 0860001 Function: 0 -POCSAG1200: Address: 0860002 Function: 0 -POCSAG1200: Address: 0860003 Function: 0 -POCSAG1200: Address: 0860004 Function: 0 -POCSAG1200: Address: 0860005 Function: 0 -POCSAG1200: Address: 0860006 Function: 0 -POCSAG1200: Address: 0860007 Function: 0 -POCSAG1200: Address: 0860008 Function: 0 -POCSAG1200: Address: 0860009 Function: 0 -POCSAG1200: Address: 0860010 Function: 0 -POCSAG1200: Address: 0871003 Function: 0 Alpha: B2 Feuer Gebäude Pers in Gefahr. bla bla bla - -# regEx-Filter? - - -# -# FMS -# --- -# -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct -FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct - - -# -# ZVEI -# ---- -# - -#with csv description -ZVEI1: 12345 -#without csv description -ZVEI1: 56789 -#duplicate -ZVEI1: 56789 -#with repeat Tone -ZVEI1: 1F2E3 -#in case of invalid id -ZVEI1: 135 -#in case of a double-tone for siren n-'D's are sended -# ZVEI1: DDD -# ZVEI1: DDDDD +# Testdata for the BOSWatch Test Mode function +# Data in Multimon-NG Raw Format +# Data is alternately passed to the decoder to simulate an used Radio-Frequency + +# +# POCSAG +# ------ +# +# The following settings in config.ini are expected for POCSAG +# +# [BOSWatch] +# useDescription = 1 +# doubleFilter_ignore_entries = 10 +# doubleFilter_check_msg = 1 +# +# [POC] +# deny_ric = 7777777 +# filter_range_start = 0000005 +# filter_range_end = 8999999 +# idDescribed = 1 +# + +# bitrate +POCSAG512: Address: 1000512 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay +POCSAG1200: Address: 1001200 Function: 1 Alpha: BOSWatch-Test: okay +POCSAG2400: Address: 1002400 Function: 1 Alpha: BOSWatch-Test: okay + +# function-code +POCSAG512: Address: 1000000 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000001 Function: 1 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000002 Function: 2 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 1000003 Function: 3 Alpha: BOSWatch-Test: okay + +# german special sign +POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test ÖÄÜß: okay +POCSAG512: Address: 1200001 Function: 1 Alpha: BOSWatch-Test öäü: okay + +# with csv +POCSAG512: Address: 1234567 Function: 1 Alpha: BOSWatch-Test: with csv + +# without csv +POCSAG1200: Address: 2345678 Function: 2 Alpha: BOSWatch-Test: without csv +POCSAG2400: Address: 3456789 Function: 3 Alpha: BOSWatch-Test: without csv + +# OHNE TEXT???? +POCSAG1200: Address: 1100000 Function: 0 +POCSAG1200: Address: 1100000 Function: 1 +POCSAG1200: Address: 1100000 Function: 2 +POCSAG1200: Address: 1100000 Function: 3 + +# duplicate with same and other msg +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2000001 Function: 2 Alpha: BOSWatch-Testing: okay + +# duplicate in different order +POCSAG1200: Address: 2100000 Function: 2 +POCSAG1200: Address: 2100001 Function: 2 +POCSAG1200: Address: 2100002 Function: 2 +POCSAG1200: Address: 2100000 Function: 2 +POCSAG1200: Address: 2100001 Function: 2 +POCSAG1200: Address: 2100002 Function: 2 +POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100000 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100001 Function: 2 Alpha: BOSWatch-Test: second is a duplicate +POCSAG1200: Address: 2100002 Function: 2 Alpha: BOSWatch-Test: second is a duplicate + +# invalid +POCSAG512: Address: 3 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 33 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 3333 Function: 0 Alpha: BOSWatch-Test: okay +POCSAG512: Address: 33333 Function: 0 Alpha: BOSWatch-Test: okay +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 + +# denied +POCSAG1200: Address: 7777777 Function: 1 Alpha: BOSWatch-Test: denied + +# out of filter Range +POCSAG1200: Address: 0000004 Function: 1 Alpha: BOSWatch-Test: out of filter start +POCSAG1200: Address: 9000000 Function: 1 Alpha: BOSWatch-Test: out of filter end + +#Probealram +POCSAG1200: Address: 0871004 Function: 1 Alpha: Dies ist ein Probealarm! +## Multicast Alarm +POCSAG1200: Address: 0871002 Function: 0 Alpha: +POCSAG1200: Address: 0860001 Function: 0 +POCSAG1200: Address: 0860002 Function: 0 +POCSAG1200: Address: 0860003 Function: 0 +POCSAG1200: Address: 0860004 Function: 0 +POCSAG1200: Address: 0860005 Function: 0 +POCSAG1200: Address: 0860006 Function: 0 +POCSAG1200: Address: 0860007 Function: 0 +POCSAG1200: Address: 0860008 Function: 0 +POCSAG1200: Address: 0860009 Function: 0 +POCSAG1200: Address: 0860010 Function: 0 +POCSAG1200: Address: 0871003 Function: 0 Alpha: B2 Feuer Gebäude Pers in Gefahr. bla bla bla + +# regEx-Filter? + + +# +# FMS +# --- +# +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct +FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct + + +# +# ZVEI +# ---- +# + +#with csv description +ZVEI1: 12345 +#without csv description +ZVEI1: 56789 +#duplicate +ZVEI1: 56789 +#with repeat Tone +ZVEI1: 1F2E3 +#in case of invalid id +ZVEI1: 135 +#in case of a double-tone for siren n-'D's are sended +# ZVEI1: DDD +# ZVEI1: DDDDD + +# [multicast] +# this part test the multicast module +POCSAG1200: Address: 2145000 Function: 2 Alpha: alarm ric #not in multicast regex filter +## you are required to define: +# multicastAlarm_textRics: 2100002,210001 +# multicastAlarm_ignore_time: 10 +# multicastAlarm_delimiterRic: 2100003 +# multicastAlarm_delimiterSubric: 0 +# @ your server.yaml +## Function corresponds to subric here +POCSAG1200: Address: 2100003 Function: 0 Alpha: delimiter +POCSAG1200: Address: 2100000 Function: 1 Alpha: alarm ric +POCSAG1200: Address: 2100002 Function: 2 Alpha: text ric says: fire in the hole +POCSAG1200: Address: 2100003 Function: 0 Alpha: delimiter +POCSAG1200: Address: 2100003 Function: 0 Alpha: delimiter +POCSAG1200: Address: 2100000 Function: 1 Alpha: alarm ric +POCSAG1200: Address: 2100002 Function: 2 Alpha: text ric says: again fire in the hole +POCSAG1200: Address: 2100003 Function: 0 Alpha: delimiter From 2aa714fae9c291e612eddc09d7310152ed062b4d Mon Sep 17 00:00:00 2001 From: Thierry Fredrich Date: Wed, 16 Feb 2022 14:41:54 +0100 Subject: [PATCH 2/4] moved init stuff to onLoad --- module/multicast.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/multicast.py b/module/multicast.py index 4b602a7..5e7dd44 100644 --- a/module/multicast.py +++ b/module/multicast.py @@ -55,6 +55,12 @@ class BoswatchModule(ModuleBase): def __init__(self, config): """!Do not change anything here!""" super().__init__(__name__, config) # you can access the config class on 'self.config' + + + def onLoad(self): + """!Called by import of the plugin + Remove if not implemented""" + logging.debug("starting multicast module") logging.debug("multicastAlarm_delimiterRic is: %i" % self.config.get("multicastAlarm_delimiterRic")) logging.debug("multicastAlarm_delimiterSubric is: %i" % self.config.get("multicastAlarm_delimiterSubric")) @@ -66,10 +72,7 @@ class BoswatchModule(ModuleBase): for aTextRic in self.config.get("multicastAlarm_textRics").split(','): self.textRics.append(int(aTextRic)) self.initStorage() - - def onLoad(self): - """!Called by import of the plugin - Remove if not implemented""" + pass def doWork(self, bwPacket): From 51cc6a0318dc1f036db860edda5f7a4ae4c920d7 Mon Sep 17 00:00:00 2001 From: Thierry Fredrich Date: Wed, 16 Feb 2022 14:42:38 +0100 Subject: [PATCH 3/4] changed return value in multicast --- module/multicast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/multicast.py b/module/multicast.py index 5e7dd44..feaee2f 100644 --- a/module/multicast.py +++ b/module/multicast.py @@ -86,7 +86,7 @@ class BoswatchModule(ModuleBase): pass else: logging.error("multicast module only works with pocsag") - raise NameError('multicast module only works with pocsag') + return False '''delimiter received''' if self.delimiterRic == thisRic and self.delimiterSubric == thisSubric: From c1f2ab0d08d8e6be279031a587b782159d4a8198 Mon Sep 17 00:00:00 2001 From: Thierry Fredrich Date: Wed, 16 Feb 2022 15:31:21 +0100 Subject: [PATCH 4/4] optimized debug logs --- module/multicast.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/multicast.py b/module/multicast.py index feaee2f..f523617 100644 --- a/module/multicast.py +++ b/module/multicast.py @@ -62,15 +62,16 @@ class BoswatchModule(ModuleBase): Remove if not implemented""" logging.debug("starting multicast module") - logging.debug("multicastAlarm_delimiterRic is: %i" % self.config.get("multicastAlarm_delimiterRic")) - logging.debug("multicastAlarm_delimiterSubric is: %i" % self.config.get("multicastAlarm_delimiterSubric")) - logging.debug("multicastAlarm_ignore_time is: %i" % self.config.get("multicastAlarm_ignore_time")) - logging.debug("multicastAlarm_textRics is: %s" % self.config.get("multicastAlarm_textRics")) + self.delimiterRic = int(self.config.get("multicastAlarm_delimiterRic")) self.delimiterSubric = int(self.config.get("multicastAlarm_delimiterSubric")) self.ignoreTime = int(self.config.get("multicastAlarm_ignore_time")) for aTextRic in self.config.get("multicastAlarm_textRics").split(','): self.textRics.append(int(aTextRic)) + logging.debug("multicastAlarm_delimiterRic is: %i" % self.delimiterRic) + logging.debug("multicastAlarm_delimiterSubric is: %i" % self.delimiterSubric) + logging.debug("multicastAlarm_ignore_time is: %i" % self.ignoreTime) + logging.debug("multicastAlarm_textRics is: %s" % self.textRics) self.initStorage() pass