From f4a6fc2c8e7250db3be540e91321299205383ec4 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Thu, 24 Aug 2023 23:28:53 +1000 Subject: [PATCH] examples/bluetooth: Link to aioble in BLE examples. Signed-off-by: Jim Mussared --- examples/bluetooth/ble_advertising.py | 4 ++++ examples/bluetooth/ble_bonding_peripheral.py | 5 +++++ examples/bluetooth/ble_simple_central.py | 5 +++++ examples/bluetooth/ble_simple_peripheral.py | 5 +++++ examples/bluetooth/ble_temperature.py | 6 ++++++ examples/bluetooth/ble_temperature_central.py | 6 ++++++ examples/bluetooth/ble_uart_peripheral.py | 5 +++++ 7 files changed, 36 insertions(+) diff --git a/examples/bluetooth/ble_advertising.py b/examples/bluetooth/ble_advertising.py index 6dc78c5e3d..2fe17d640b 100644 --- a/examples/bluetooth/ble_advertising.py +++ b/examples/bluetooth/ble_advertising.py @@ -1,5 +1,9 @@ # Helpers for generating BLE advertising payloads. +# A more fully-featured (and easier to use) version of this is implemented in +# aioble. This code is provided just as a basic example. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble + from micropython import const import struct import bluetooth diff --git a/examples/bluetooth/ble_bonding_peripheral.py b/examples/bluetooth/ble_bonding_peripheral.py index bd7596dbcb..c3ae5f262a 100644 --- a/examples/bluetooth/ble_bonding_peripheral.py +++ b/examples/bluetooth/ble_bonding_peripheral.py @@ -4,6 +4,11 @@ # any connected central every 10 seconds. # # Work-in-progress demo of implementing bonding and passkey auth. +# +# This example demonstrates the low-level bluetooth module. For most +# applications, we recommend using the higher-level aioble library, which +# includes an implementation of the secret store. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble import bluetooth import random diff --git a/examples/bluetooth/ble_simple_central.py b/examples/bluetooth/ble_simple_central.py index 3c0cf2a0d4..caf6333472 100644 --- a/examples/bluetooth/ble_simple_central.py +++ b/examples/bluetooth/ble_simple_central.py @@ -1,6 +1,11 @@ # This example finds and connects to a peripheral running the # UART service (e.g. ble_simple_peripheral.py). +# This example demonstrates the low-level bluetooth module. For most +# applications, we recommend using the higher-level aioble library which takes +# care of all IRQ handling and connection management. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble + import bluetooth import random import struct diff --git a/examples/bluetooth/ble_simple_peripheral.py b/examples/bluetooth/ble_simple_peripheral.py index 0ebe431764..bdb5ed88c7 100644 --- a/examples/bluetooth/ble_simple_peripheral.py +++ b/examples/bluetooth/ble_simple_peripheral.py @@ -1,5 +1,10 @@ # This example demonstrates a UART periperhal. +# This example demonstrates the low-level bluetooth module. For most +# applications, we recommend using the higher-level aioble library which takes +# care of all IRQ handling and connection management. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble + import bluetooth import random import struct diff --git a/examples/bluetooth/ble_temperature.py b/examples/bluetooth/ble_temperature.py index e6378ebee7..acd77127ad 100644 --- a/examples/bluetooth/ble_temperature.py +++ b/examples/bluetooth/ble_temperature.py @@ -3,6 +3,12 @@ # The sensor's local value updates every second, and it will notify # any connected central every 10 seconds. +# This example demonstrates the low-level bluetooth module. For most +# applications, we recommend using the higher-level aioble library which takes +# care of all IRQ handling and connection management. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble +# and in particular the temp_sensor.py example included with aioble. + import bluetooth import random import struct diff --git a/examples/bluetooth/ble_temperature_central.py b/examples/bluetooth/ble_temperature_central.py index afa914672c..fe1c70636f 100644 --- a/examples/bluetooth/ble_temperature_central.py +++ b/examples/bluetooth/ble_temperature_central.py @@ -1,5 +1,11 @@ # This example finds and connects to a BLE temperature sensor (e.g. the one in ble_temperature.py). +# This example demonstrates the low-level bluetooth module. For most +# applications, we recommend using the higher-level aioble library which takes +# care of all IRQ handling and connection management. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble +# and in particular the temp_client.py example included with aioble. + import bluetooth import random import struct diff --git a/examples/bluetooth/ble_uart_peripheral.py b/examples/bluetooth/ble_uart_peripheral.py index b4e352be9f..0de4fe2ed4 100644 --- a/examples/bluetooth/ble_uart_peripheral.py +++ b/examples/bluetooth/ble_uart_peripheral.py @@ -1,5 +1,10 @@ # This example demonstrates a peripheral implementing the Nordic UART Service (NUS). +# This example demonstrates the low-level bluetooth module. For most +# applications, we recommend using the higher-level aioble library which takes +# care of all IRQ handling and connection management. See +# https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble + import bluetooth from ble_advertising import advertising_payload