1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

rename the traffic log from something hidden

This commit is contained in:
Joel Bender 2017-09-25 21:16:34 -04:00
parent 3ff3a036d6
commit d491f649c0

View File

@ -35,8 +35,8 @@ class Network:
self.broadcast_address = broadcast_address
self.drop_percent = drop_percent
# hidden sniffer function
self._sniffer = None
# point to a TrafficLog instance
self.traffic_log = None
def add_node(self, node):
""" Add a node to this network, let the node know which network it's on. """
@ -62,9 +62,9 @@ class Network:
"""
if _debug: Network._debug("process_pdu(%s) %r", self.name, pdu)
# if there is a sniffer, call it with the network name and pdu
if self._sniffer:
self._sniffer(self.name, pdu)
# if there is a traffic log, call it with the network name and pdu
if self.traffic_log:
self.traffic_log(self.name, pdu)
# randomly drop a packet
if self.drop_percent != 0.0: