BOSWatch 3
Python Script to receive and decode German BOS Information with rtl_fm and multimon-NG
 
Loading...
Searching...
No Matches
module.packetDump.BoswatchModule Class Reference

Ein Diagnose-Modul, das den kompletten Inhalt des bwPacket-Objekts im Log ausgibt. More...

Public Member Functions

 __init__ (self, config)
 Do not change anything here!
 
 onLoad (self)
 Called by import of the plugin.
 
 doWork (self, bwPacket)
 start an run of the module.
 
 onUnload (self)
 Called by destruction of the plugin Remove if not implemented.
 

Data Fields

 title
 
- Data Fields inherited from module.moduleBase.ModuleBase
 config
 

Additional Inherited Members

- Static Public Member Functions inherited from module.moduleBase.ModuleBase
 registerWildcard (newWildcard, bwPacketField)
 Register a new wildcard.
 
- Protected Member Functions inherited from module.moduleBase.ModuleBase
 _cleanup (self)
 Cleanup routine calls onUnload() directly.
 
 _run (self, bwPacket)
 start an run of the module.
 
 _getStatistics (self)
 Returns statistical information's from last module run.
 
- Protected Attributes inherited from module.moduleBase.ModuleBase
 _moduleName
 
 _cumTime
 
 _moduleTime
 
 _runCount
 
 _moduleErrorCount
 
- Static Protected Attributes inherited from module.moduleBase.ModuleBase
list _modulesActive = []
 

Detailed Description

Ein Diagnose-Modul, das den kompletten Inhalt des bwPacket-Objekts im Log ausgibt.

Constructor & Destructor Documentation

◆ __init__()

module.packetDump.BoswatchModule.__init__ (   self,
  config 
)

Do not change anything here!

Reimplemented from module.moduleBase.ModuleBase.

27 def __init__(self, config):
28 r"""!Do not change anything here!"""
29 super().__init__(__name__, config) # you can access the config class on 'self.config'
30

Member Function Documentation

◆ onLoad()

module.packetDump.BoswatchModule.onLoad (   self)

Called by import of the plugin.

Reimplemented from module.moduleBase.ModuleBase.

31 def onLoad(self):
32 r"""!Called by import of the plugin"""
33 self.title = self.config.get("title", default="Packet Dump")
34

◆ doWork()

module.packetDump.BoswatchModule.doWork (   self,
  bwPacket 
)

start an run of the module.

Parameters
bwPacketA BOSWatch packet instance Gibt das Paket unverändert weiter, loggt aber den aktuellen Zustand.

Reimplemented from module.moduleBase.ModuleBase.

35 def doWork(self, bwPacket):
36 r"""!start an run of the module.
37
38 @param bwPacket: A BOSWatch packet instance
39 Gibt das Paket unverändert weiter, loggt aber den aktuellen Zustand.
40 """
41 logging.debug("======= [DEBUG DUMP: %s] =======", self.title)
42
43 try:
44 # vars(bwPacket) extrahiert alle Attribute und internen Dicts des Objekts, damit wir auch die dynamisch hinzugefügten Multicast-Felder sehen.
45 packet_details = vars(bwPacket)
46 logging.debug("\n" + pprint.pformat(packet_details))
47 except Exception as e:
48 # Failsafe, falls vars() bei sehr speziellen Objekten fehlschlägt
49 logging.warning(f"Konnte Paket-Details nicht vollständig auslesen: {e}")
50 logging.debug("\n" + pprint.pformat(bwPacket))
51
52 logging.debug("==========================================")
53
54 return bwPacket
55

◆ onUnload()

module.packetDump.BoswatchModule.onUnload (   self)

Called by destruction of the plugin Remove if not implemented.

Reimplemented from module.moduleBase.ModuleBase.

56 def onUnload(self):
57 r"""!Called by destruction of the plugin
58 Remove if not implemented"""
59 pass

Field Documentation

◆ title

module.packetDump.BoswatchModule.title