Indication of external ReadProperty, ReadPropertyMultiple, WriteProperty etc. Request #416
-
I am sure there is a way to do this but after an hour or so I am not getting any closer to figuring it out myself so I figured I would ask. I have set up a Raspberry Pi as a BACnet device using BACpypes and can communicate with it using YABE. When I click on an Object in YABE I can see in a Wireshark capture that there is a ReadPropertyMultiple Request that goes from my computer to my PI. There is then a ComplexACK returned from my Pi to my computer. What I want to know is how can I see this event triggered in my code? I want to be able to trigger events based on incoming requests so I want to do something like:
I just dont know what im looking for to get something like ".incoming_request" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are a couple ways to solve this. First, by recognizing that part of the request/indication/response/confirmation pattern is that as a server, your application's @bacpypes_debugging
class MyApplication(BIPSimpleApplication):
def indication(self, apdu):
if _debug: MyApplication._debug("indication %r", apdu)
if isinstance(apdu, ReadPropertyMultipleRequest):
if _debug: MyApplication._debug(" - got one!")
# continue along
BIPSimpleApplication.indication(self, apdu) The basic operation of the @bacpypes_debugging
class MyApplication(BIPSimpleApplication):
def do_ReadPropertyRequest(self, apdu):
"""Return the value of some property of one of our objects."""
if _debug: MyApplication._debug("do_ReadPropertyRequest %r", apdu)
# continue along
BIPSimpleApplication.do_ReadPropertyRequest(self, apdu) Be a little careful with this second method because by virtue of having a |
Beta Was this translation helpful? Give feedback.
There are a couple ways to solve this. First, by recognizing that part of the request/indication/response/confirmation pattern is that as a server, your application's
indication()
is going to be called, so you can see it like this:The basic operation of the
indication()
function is to look for a peer function for the APDU type (patterne…