aboutsummaryrefslogtreecommitdiff
path: root/tests/multi_bluetooth
diff options
context:
space:
mode:
authorDamien George2020-09-23 23:18:16 +1000
committerDamien George2020-09-25 12:23:11 +1000
commit81f2162ca0e926c9a4a1787a3863d94d86be0b36 (patch)
treef95015b865cebc228ec47a24d4f2dfaa7b5223a6 /tests/multi_bluetooth
parent50e34f979c90584273a67ecd9189640417a60960 (diff)
extmod/modbluetooth: Change module-owned bytes objects to memoryview.
A read-only memoryview object is a better representation of the data, which is owned by the ubluetooth module and may change between calls to the user's irq callback function. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/multi_bluetooth')
-rw-r--r--tests/multi_bluetooth/ble_characteristic.py6
-rw-r--r--tests/multi_bluetooth/ble_gap_device_name.py2
-rw-r--r--tests/multi_bluetooth/ble_gatt_data_transfer.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/multi_bluetooth/ble_characteristic.py b/tests/multi_bluetooth/ble_characteristic.py
index d918d9aef..026b9d551 100644
--- a/tests/multi_bluetooth/ble_characteristic.py
+++ b/tests/multi_bluetooth/ble_characteristic.py
@@ -54,15 +54,15 @@ def irq(event, data):
print("_IRQ_GATTC_CHARACTERISTIC_RESULT", data[-1])
value_handle = data[2]
elif event == _IRQ_GATTC_READ_RESULT:
- print("_IRQ_GATTC_READ_RESULT", data[-1])
+ print("_IRQ_GATTC_READ_RESULT", bytes(data[-1]))
elif event == _IRQ_GATTC_READ_DONE:
print("_IRQ_GATTC_READ_DONE", data[-1])
elif event == _IRQ_GATTC_WRITE_DONE:
print("_IRQ_GATTC_WRITE_DONE", data[-1])
elif event == _IRQ_GATTC_NOTIFY:
- print("_IRQ_GATTC_NOTIFY", data[-1])
+ print("_IRQ_GATTC_NOTIFY", bytes(data[-1]))
elif event == _IRQ_GATTC_INDICATE:
- print("_IRQ_GATTC_INDICATE", data[-1])
+ print("_IRQ_GATTC_INDICATE", bytes(data[-1]))
elif event == _IRQ_GATTS_INDICATE_DONE:
print("_IRQ_GATTS_INDICATE_DONE", data[-1])
diff --git a/tests/multi_bluetooth/ble_gap_device_name.py b/tests/multi_bluetooth/ble_gap_device_name.py
index 92ea94278..fbc9d80ba 100644
--- a/tests/multi_bluetooth/ble_gap_device_name.py
+++ b/tests/multi_bluetooth/ble_gap_device_name.py
@@ -36,7 +36,7 @@ def irq(event, data):
print("_IRQ_GATTC_CHARACTERISTIC_RESULT", data[-1])
value_handle = data[2]
elif event == _IRQ_GATTC_READ_RESULT:
- print("_IRQ_GATTC_READ_RESULT", data[-1])
+ print("_IRQ_GATTC_READ_RESULT", bytes(data[-1]))
if waiting_event is not None:
if isinstance(waiting_event, int) and event == waiting_event:
diff --git a/tests/multi_bluetooth/ble_gatt_data_transfer.py b/tests/multi_bluetooth/ble_gatt_data_transfer.py
index 240f04860..944c9e2d2 100644
--- a/tests/multi_bluetooth/ble_gatt_data_transfer.py
+++ b/tests/multi_bluetooth/ble_gatt_data_transfer.py
@@ -67,7 +67,7 @@ def irq(event, data):
elif event == _IRQ_GATTC_WRITE_DONE:
print("_IRQ_GATTC_WRITE_DONE", data[-1])
elif event == _IRQ_GATTC_NOTIFY:
- print("_IRQ_GATTC_NOTIFY", data[-1])
+ print("_IRQ_GATTC_NOTIFY", bytes(data[-1]))
if waiting_event is not None:
if (isinstance(waiting_event, int) and event == waiting_event) or (