aioble - multiple connections to a peripheral? #9775
Answered
by
ser
ser
asked this question in
Libraries & Drivers
-
How can I have temperature service from aioble examples available for multiple connections? Currently when there is a connection, the peripheral stops announcements - I want it to NOT stop and serve concurrent clients. |
Beta Was this translation helpful? Give feedback.
Answered by
ser
Oct 29, 2022
Replies: 2 comments 5 replies
-
Roughly you need to do something like: async def server_task(conn):
...
async def peripheral_task():
while True:
conn = aioble.advertise(...)
asyncio.create_task(server_task(conn)) |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thanks for explanation, but I believe your code misses necessary
This works correctly for me. Thanks again! |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
ser
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for explanation, but I believe your code misses necessary
await
, it should be:This works correctly for me. Thanks again!