Skip to content

Commit

Permalink
print out the incoming routing message content
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Bender committed Jun 13, 2018
1 parent a885e4f commit a3c9f1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion samples/WhoIsRouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from bacpypes.core import run, enable_sleeping

from bacpypes.pdu import Address
from bacpypes.npdu import InitializeRoutingTable, WhoIsRouterToNetwork
from bacpypes.npdu import InitializeRoutingTable, WhoIsRouterToNetwork, IAmRouterToNetwork

from bacpypes.app import BIPNetworkApplication

Expand Down Expand Up @@ -41,6 +41,10 @@ def request(self, adapter, npdu):

def indication(self, adapter, npdu):
if _debug: WhoIsRouterApplication._debug("indication %r %r", adapter, npdu)

if isinstance(npdu, IAmRouterToNetwork):
print("{} -> {}, {}".format(npdu.pduSource, npdu.pduDestination, npdu.iartnNetworkList))

BIPNetworkApplication.indication(self, adapter, npdu)

def response(self, adapter, npdu):
Expand Down

0 comments on commit a3c9f1e

Please sign in to comment.