-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification Needed: Differences Between BACpypes and BACpypes3 & Issue with elementService Attribute #58
Comments
bacpypes3 is all asyncio based. I am not sure if it does the same "binding process" as legacy bacpypes. If you samples/discover-devices.py |
Re @bbartling comments about binding, BACpypes3 has a very similar architecture to legacy BACpypes, the request/indication/response/confirmation design pattern is the same (the functions are now There are substantial differences with primitive data (for example the The biggest difference for your application is that when you import asyncio
from itertools import chain
from bacpypes3.debugging import ModuleLogger
from bacpypes3.argparse import SimpleArgumentParser
from bacpypes3.pdu import Address
from bacpypes3.app import Application
# some debugging
_debug = 0
_log = ModuleLogger(globals())
async def main() -> None:
app = None
try:
args = SimpleArgumentParser().parse_args()
if _debug:
_log.debug("args: %r", args)
# build an application
app = Application.from_args(args)
if _debug:
_log.debug("app: %r", app)
# run the query
task_result_list = await asyncio.gather(
app.who_is(), app.who_is(address=Address("192.168.1.100"))
)
if _debug:
_log.debug(" - task_result_list: %r", task_result_list)
for i_am in chain.from_iterable(task_result_list):
if _debug:
_log.debug(" - i_am: %r", i_am)
print(f"{i_am.iAmDeviceIdentifier[1]} at {i_am.pduSource}")
finally:
if app:
app.close()
if __name__ == "__main__":
asyncio.run(main())``` |
Hello,
I've been working with the new BACpypes3 library and am trying to transition some of the functionality from the original BACpypes to BACpypes3. Specifically, I attempted to create a custom class inheriting from Application to perform a "Who-Is" request.
However, I encountered an error:
In BACpypes, I was binding components together, but it seems that the equivalent mechanisms or patterns have changed or been removed in BACpypes3.
Could you please clarify:
The text was updated successfully, but these errors were encountered: