Skip to content

Commit 23b3c7f

Browse files
jimmodpgeorge
authored andcommitted
aioble/multitests: Fix existing multitests.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 5a86aa5 commit 23b3c7f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

micropython/bluetooth/aioble/multitests/ble_characteristic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ async def instance0_task():
6666
print("written", characteristic.read())
6767
print("write")
6868
characteristic.write("periph3")
69-
print("indicate", await characteristic.indicate(connection, timeout_ms=TIMEOUT_MS))
69+
print("indicate")
70+
await characteristic.indicate(connection, timeout_ms=TIMEOUT_MS)
7071

7172
# Wait for the central to disconnect.
7273
await connection.disconnected(timeout_ms=TIMEOUT_MS)
@@ -77,7 +78,7 @@ def instance0():
7778
try:
7879
asyncio.run(instance0_task())
7980
finally:
80-
aioble.ble.active(0)
81+
aioble.stop()
8182

8283

8384
# Acting in central role.
@@ -132,4 +133,4 @@ def instance1():
132133
try:
133134
asyncio.run(instance1_task())
134135
finally:
135-
aioble.ble.active(0)
136+
aioble.stop()

micropython/bluetooth/aioble/multitests/ble_characteristic.py.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ written b'central1'
88
notify
99
written b'central2'
1010
write
11-
indicate 0
11+
indicate
1212
disconnected
1313
--- instance1 ---
1414
connect

micropython/bluetooth/aioble/multitests/perf_gatt_notify.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def register_server():
2929
return server_characteristic
3030

3131

32-
async def discover_server():
32+
async def discover_server(connection):
3333
client_service = await connection.service(SERVICE_UUID)
3434
return await client_service.characteristic(CHAR_UUID)
3535

@@ -45,7 +45,7 @@ async def instance0_task():
4545
20_000, adv_data=b"\x02\x01\x06\x04\xffMPY", timeout_ms=TIMEOUT_MS
4646
)
4747

48-
client_characteristic = await discover_server()
48+
client_characteristic = await discover_server(connection)
4949

5050
# Give the central enough time to discover chars.
5151
await asyncio.sleep_ms(500)
@@ -73,7 +73,7 @@ def instance0():
7373
try:
7474
asyncio.run(instance0_task())
7575
finally:
76-
aioble.ble.active(0)
76+
aioble.stop()
7777

7878

7979
# Acting in central role.
@@ -85,7 +85,7 @@ async def instance1_task():
8585
device = aioble.Device(*BDADDR)
8686
connection = await device.connect(timeout_ms=TIMEOUT_MS)
8787

88-
client_characteristic = await discover_server()
88+
client_characteristic = await discover_server(connection)
8989

9090
for i in range(_NUM_NOTIFICATIONS):
9191
# Wait for notification and send response.
@@ -100,4 +100,4 @@ def instance1():
100100
try:
101101
asyncio.run(instance1_task())
102102
finally:
103-
aioble.ble.active(0)
103+
aioble.stop()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy