Skip to content

Commit f9b60a2

Browse files
committed
tests/multi_bluetooth/ble_subscribe: Use end_handle in desc discovery.
Obtaining the end_handle was added in cacc96d. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent a2df439 commit f9b60a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/multi_bluetooth/ble_subscribe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def irq(event, data):
5151
elif event == _IRQ_PERIPHERAL_DISCONNECT:
5252
print("_IRQ_PERIPHERAL_DISCONNECT")
5353
elif event == _IRQ_GATTC_CHARACTERISTIC_RESULT:
54-
# conn_handle, def_handle, value_handle, properties, uuid = data
54+
# conn_handle, end_handle, value_handle, properties, uuid = data
5555
if data[-1] == CHAR_UUID:
5656
print("_IRQ_GATTC_CHARACTERISTIC_RESULT", data[-1])
57-
waiting_events[event] = data[2]
57+
waiting_events[event] = (data[2], data[1])
5858
else:
5959
return
6060
elif event == _IRQ_GATTC_CHARACTERISTIC_DONE:
@@ -179,11 +179,11 @@ def instance1():
179179

180180
# Discover characteristics.
181181
ble.gattc_discover_characteristics(conn_handle, 1, 65535)
182-
value_handle = wait_for_event(_IRQ_GATTC_CHARACTERISTIC_RESULT, TIMEOUT_MS)
182+
value_handle, end_handle = wait_for_event(_IRQ_GATTC_CHARACTERISTIC_RESULT, TIMEOUT_MS)
183183
wait_for_event(_IRQ_GATTC_CHARACTERISTIC_DONE, TIMEOUT_MS)
184184

185185
# Discover CCCD.
186-
ble.gattc_discover_descriptors(conn_handle, value_handle, value_handle + 5)
186+
ble.gattc_discover_descriptors(conn_handle, value_handle, end_handle)
187187
cccd_handle = wait_for_event(_IRQ_GATTC_DESCRIPTOR_RESULT, TIMEOUT_MS)
188188
wait_for_event(_IRQ_GATTC_DESCRIPTOR_DONE, TIMEOUT_MS)
189189

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