Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented multicast alarms #88

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

thierry3000
Copy link

I implemented a first sketch of a new module processing multicast alarms.

Copy link
Member

@Schrolli91 Schrolli91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a quick look. At the moment i have no time for a detailed deep review.
But i will do it as soon as possible.

Comment on lines 58 to 68
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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in the onLoad() method below.
The Init must not be changed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I will change that accordingly.

pass
else:
logging.error("multicast module only works with pocsag")
raise NameError('multicast module only works with pocsag')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please respect the defined return values for the modules.
See "Rückgabewert bei Modulen".
https://docs.boswatch.de/develop/ModulPlugin.html#arbeiten-mit-dem-bwpacket

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A module should return either of these: bwPacket, False, None

According to the manual, "False" simply stops the Router. In the above situation, everything should stop because the user demands something impossible? Is raising an error a problem for the rest of the logic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently not sure where this exception will be caught, but I think it will kill the entire server application.
The idea behind this router concept is that you can also have multiple types of messages in a single pipeline.

So it is possible that I want to send ZVEI and POCSAG via a single pipeline (e.g. send by Telegram), but only the POCSAG files should be modified by this module.
For me this is not a error as nothing will break if you return False

@Schrolli91 Schrolli91 linked an issue Feb 17, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are multicast alarms possible?
2 participants