1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

make it easier to create foreign device network applications

This commit is contained in:
Joel Bender
2019-03-08 11:10:35 -05:00
parent 0d50b2092a
commit 4412baf15d
3 changed files with 17 additions and 8 deletions

View File

@@ -598,7 +598,7 @@ bacpypes_debugging(BIPForeignApplication)
class BIPNetworkApplication(NetworkServiceElement):
def __init__(self, localAddress, eID=None):
def __init__(self, localAddress, bbmdAddress=None, bbmdTTL=None, eID=None):
if _debug: BIPNetworkApplication._debug("__init__ %r eID=%r", localAddress, eID)
NetworkServiceElement.__init__(self, eID)
@@ -616,7 +616,10 @@ class BIPNetworkApplication(NetworkServiceElement):
# create a generic BIP stack, bound to the Annex J server
# on the UDP multiplexer
self.bip = BIPSimple()
if (not bbmdAddress) and (not bbmdTTL):
self.bip = BIPSimple()
else:
self.bip = BIPForeign(bbmdAddress, bbmdTTL)
self.annexj = AnnexJCodec()
self.mux = UDPMultiplexer(self.localAddress)