aboutsummaryrefslogtreecommitdiff
path: root/tests/multi_bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'tests/multi_bluetooth')
-rw-r--r--tests/multi_bluetooth/ble_characteristic.py8
-rw-r--r--tests/multi_bluetooth/ble_characteristic.py.exp1
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/multi_bluetooth/ble_characteristic.py b/tests/multi_bluetooth/ble_characteristic.py
index fd6fd4672..0d72c181f 100644
--- a/tests/multi_bluetooth/ble_characteristic.py
+++ b/tests/multi_bluetooth/ble_characteristic.py
@@ -17,12 +17,13 @@ _IRQ_GATTC_READ_DONE = const(16)
_IRQ_GATTC_WRITE_DONE = const(17)
_IRQ_GATTC_NOTIFY = const(18)
_IRQ_GATTC_INDICATE = const(19)
+_IRQ_GATTS_INDICATE_DONE = const(20)
SERVICE_UUID = bluetooth.UUID("A5A5A5A5-FFFF-9999-1111-5A5A5A5A5A5A")
CHAR_UUID = bluetooth.UUID("00000000-1111-2222-3333-444444444444")
CHAR = (
CHAR_UUID,
- bluetooth.FLAG_READ | bluetooth.FLAG_WRITE | bluetooth.FLAG_NOTIFY,
+ bluetooth.FLAG_READ | bluetooth.FLAG_WRITE | bluetooth.FLAG_NOTIFY | bluetooth.FLAG_INDICATE,
)
SERVICE = (
SERVICE_UUID,
@@ -62,6 +63,8 @@ def irq(event, data):
print("_IRQ_GATTC_NOTIFY", data[-1])
elif event == _IRQ_GATTC_INDICATE:
print("_IRQ_GATTC_INDICATE", data[-1])
+ elif event == _IRQ_GATTS_INDICATE_DONE:
+ print("_IRQ_GATTS_INDICATE_DONE", data[-1])
if waiting_event is not None:
if (isinstance(waiting_event, int) and event == waiting_event) or (
@@ -128,6 +131,9 @@ def instance0():
print("gatts_indicate")
ble.gatts_indicate(conn_handle, char_handle)
+ # Wait for the indicate ack.
+ wait_for_event(_IRQ_GATTS_INDICATE_DONE, TIMEOUT_MS)
+
# Wait for the central to disconnect.
wait_for_event(_IRQ_CENTRAL_DISCONNECT, TIMEOUT_MS)
finally:
diff --git a/tests/multi_bluetooth/ble_characteristic.py.exp b/tests/multi_bluetooth/ble_characteristic.py.exp
index 7f66a4d90..25b5544ef 100644
--- a/tests/multi_bluetooth/ble_characteristic.py.exp
+++ b/tests/multi_bluetooth/ble_characteristic.py.exp
@@ -9,6 +9,7 @@ gatts_notify
_IRQ_GATTS_WRITE b'central2'
gatts_write
gatts_indicate
+_IRQ_GATTS_INDICATE_DONE 0
_IRQ_CENTRAL_DISCONNECT
--- instance1 ---
gap_connect