From efea2676dfdfa9e503eb8391a1bf6733172028dc Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Fri, 15 Dec 2017 10:59:38 -0500 Subject: [PATCH 1/3] use the other parameter, when=0 means something different than delta=0 (but probably shouldn't) --- BACpypes~.ini | 1 - py25/bacpypes/bvllservice.py | 2 +- py27/bacpypes/bvllservice.py | 2 +- py34/bacpypes/bvllservice.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BACpypes~.ini b/BACpypes~.ini index 6740dc4..dc8bac0 100644 --- a/BACpypes~.ini +++ b/BACpypes~.ini @@ -5,7 +5,6 @@ objectIdentifier: 599 maxApduLengthAccepted: 1024 segmentationSupported: segmentedBoth vendorIdentifier: 15 -foreignPort: 0 foreignBBMD: 128.253.109.254 foreignTTL: 30 diff --git a/py25/bacpypes/bvllservice.py b/py25/bacpypes/bvllservice.py index af4128c..e195d39 100755 --- a/py25/bacpypes/bvllservice.py +++ b/py25/bacpypes/bvllservice.py @@ -542,7 +542,7 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): self.bbmdTimeToLive = ttl # install this task to run when it gets a chance - self.install_task(delta=0) + self.install_task(when=0) def unregister(self): """Drop the registration with a BBMD.""" diff --git a/py27/bacpypes/bvllservice.py b/py27/bacpypes/bvllservice.py index 5abb24e..8c01f05 100755 --- a/py27/bacpypes/bvllservice.py +++ b/py27/bacpypes/bvllservice.py @@ -538,7 +538,7 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): self.bbmdTimeToLive = ttl # install this task to run when it gets a chance - self.install_task(delta=0) + self.install_task(when=0) def unregister(self): """Drop the registration with a BBMD.""" diff --git a/py34/bacpypes/bvllservice.py b/py34/bacpypes/bvllservice.py index 6abb5d7..2a6285c 100755 --- a/py34/bacpypes/bvllservice.py +++ b/py34/bacpypes/bvllservice.py @@ -537,7 +537,7 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): self.bbmdTimeToLive = ttl # install this task to run when it gets a chance - self.install_task(delta=0) + self.install_task(when=0) def unregister(self): """Drop the registration with a BBMD.""" From 0191fe15641b99141501946a22c3f1a7a8cadeaf Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Sun, 17 Dec 2017 17:25:21 -0500 Subject: [PATCH 2/3] fix debugging --- samples/WhoIsIAmForeign.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/WhoIsIAmForeign.py b/samples/WhoIsIAmForeign.py index 38e2917..38623dc 100755 --- a/samples/WhoIsIAmForeign.py +++ b/samples/WhoIsIAmForeign.py @@ -115,7 +115,7 @@ class WhoIsIAmConsoleCmd(ConsoleCmd): # make an IOCB iocb = IOCB(request) - if _debug: WriteSomethingConsoleCmd._debug(" - iocb: %r", iocb) + if _debug: WhoIsIAmConsoleCmd._debug(" - iocb: %r", iocb) # give it to the application this_application.request_io(iocb) @@ -142,7 +142,7 @@ class WhoIsIAmConsoleCmd(ConsoleCmd): # make an IOCB iocb = IOCB(request) - if _debug: WriteSomethingConsoleCmd._debug(" - iocb: %r", iocb) + if _debug: WhoIsIAmConsoleCmd._debug(" - iocb: %r", iocb) # give it to the application this_application.request_io(iocb) From c4aca25485ab66c49c65e3d750e3c1e8750a3c2f Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Sun, 17 Dec 2017 23:09:08 -0500 Subject: [PATCH 3/3] add some docs --- samples/WhoIsIAmForeign.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/samples/WhoIsIAmForeign.py b/samples/WhoIsIAmForeign.py index 38623dc..a2eb613 100755 --- a/samples/WhoIsIAmForeign.py +++ b/samples/WhoIsIAmForeign.py @@ -4,6 +4,16 @@ This application presents a 'console' prompt to the user asking for Who-Is and I-Am commands which create the related APDUs, then lines up the coorresponding I-Am for incoming traffic and prints out the contents. + +In addition to the usual INI parameters that are common to BACpypes applications, +this application references two additional parameters: + + foreignBBMD: the BACpypes IP Address of the BBMD to register + foreignTTL: the time-to-live to keep the registration alive + +The BBMDForeign class will send the BVLL registration request after the core +starts up and maintain it. If the device does not get an 'ack' then it will +not send requests, even to devices that it would be able to talk otherwise. """ import sys