From eb3f7b8ee33cf52ae3a18da71bafd4e931a2a20c Mon Sep 17 00:00:00 2001 From: juanba <43823333+juanbaromance@users.noreply.github.com> Date: Sun, 27 Aug 2023 19:32:03 +0200 Subject: [PATCH 1/2] Update ble-device-to-device.md fix subscription protocol --- .../tutorials/ble-device-to-device/ble-device-to-device.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md b/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md index 3b085b4059..988f09d084 100644 --- a/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md +++ b/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md @@ -55,7 +55,7 @@ When a Bluetooth® connection is established, one device, the peripheral, will a A **service** is a group of **capabilities**. For example, a smartwatch can measure your heart rate, track your physical activity through the day and track your sleep patterns. These three capabilities, for example, would exist in a service called **health service**. By grouping capabilities in services, central devices allow peripheral devices to quickly find, select and interact with the desired services they want. Any service has a unique identification code called **UUID**. This code can be 16-bit or 32-bit long for official Bluetooth® specification services while non-official Bluetooth® services (the ones we can develop) are 128-bit long, UUIDs can be created randomly. A **profile** is a group of services. -Within each service will exist a list of **characteristics**. Each one of these characteristics represents a unique capability of the central device. In the previous example, the health service would have three characteristics (heart rate, physical activity, and sleep pattern). **Once the peripheral device discovers these characteristics, it can write information to, request information from, and subscribe to updates from these characteristics**. Any characteristic, like the services, have a 16 bit long or 128 bit long UUID. +Within each service will exist a list of **characteristics**. Each one of these characteristics represents a unique capability of the peripherical device. In the previous example, the health service would have three characteristics (heart rate, physical activity, and sleep pattern). **Once the central device discovers these characteristics, it can write information to, request information from, and subscribe to updates from these characteristics**. Any characteristic, like the services, have a 16 bit long or 128 bit long UUID. ![Health service example.](assets/nano_ble_sense_t2_img02.png) @@ -425,4 +425,4 @@ Sometimes errors occur, if one of the codes is not working there are some common ## Conclusion -In this tutorial, we have learned how to exchange information between two Arduino boards, the Nano 33 BLE and the Nano 33 BLE Sense, through Bluetooth® Low Energy. We also learned the basics of Bluetooth® Low Energy, how does it works, what are services and characteristics, and how information is exchanged in Bluetooth® Low Energy. Lastly, we turn on different colors of the on-board RGB LED of the Nano 33 BLE board based on the values sent from the Nano 33 BLE Sense, those values were defined using its onboard gesture sensor. \ No newline at end of file +In this tutorial, we have learned how to exchange information between two Arduino boards, the Nano 33 BLE and the Nano 33 BLE Sense, through Bluetooth® Low Energy. We also learned the basics of Bluetooth® Low Energy, how does it works, what are services and characteristics, and how information is exchanged in Bluetooth® Low Energy. Lastly, we turn on different colors of the on-board RGB LED of the Nano 33 BLE board based on the values sent from the Nano 33 BLE Sense, those values were defined using its onboard gesture sensor. From e7617ba489fa558d542722f35aae1e5af438f7f9 Mon Sep 17 00:00:00 2001 From: juanba <43823333+juanbaromance@users.noreply.github.com> Date: Sun, 27 Aug 2023 19:53:13 +0200 Subject: [PATCH 2/2] Roles fixing on BLE service dynamics --- .../tutorials/ble-device-to-device/ble-device-to-device.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md b/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md index 988f09d084..6778608543 100644 --- a/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md +++ b/content/hardware/03.nano/boards/nano-33-ble-sense/tutorials/ble-device-to-device/ble-device-to-device.md @@ -61,7 +61,7 @@ Within each service will exist a list of **characteristics**. Each one of these ### Information Exchange in Bluetooth® Low Energy -There are three ways data can be exchanged between two connected devices: **reading**, **writing**, or **notifying**. **Reading** occurs when a peripheral device asks the central device for specific information, think about a smartphone asking a smartwatch for the physical activity information, this is an example of reading. **Writing** occurs when a peripheral device writes specific information in the central device, think about a smartphone changing the password of a smartwatch, this is an example of writing. **Notifying** occurs when a central device offers information to the peripheral device using a notification, think about a smartwatch notifying a smartphone its battery is low and needs to be recharged. +There are three ways data can be exchanged between two connected devices: **reading**, **writing**, or **notifying**. **Reading** occurs when a central device asks the peripheral device for specific information, think about a smartphone asking a smartwatch for the physical activity information, this is an example of reading. **Writing** occurs when a central device writes specific information in the peripheral device, think about a smartphone changing the password of a smartwatch, this is an example of writing. **Notifying** occurs when a peripheral device offers information to the central device using a notification, think about a smartwatch notifying a smartphone its battery is low and needs to be recharged. Well, that's what we need to know about Bluetooth® Low Energy for now. Bluetooth® specifications are quite extensive but interesting to read and learn about. If you want to know more about Bluetooth® Low Energy, check out [**Getting Started with Bluetooth® Low Energy** by Kevin Townsend, Carles Cufí, Akiba, and Robert Davidson](https://www.oreilly.com/library/view/getting-started-with/9781491900550/).