This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:practical:hardware:sut:esp32:iot_9 [2024/05/02 11:07] – [Prerequisites] ktokarz | en:iot-open:practical:hardware:sut:esp32:iot_9 [2024/05/04 09:20] (current) – ktokarz | ||
---|---|---|---|
Line 11: | Line 11: | ||
===== Hands-on Lab Scenario ===== | ===== Hands-on Lab Scenario ===== | ||
- | This scenario is intended to be implemented using two BLE laboratory nodes. One of them is a server, while the second is a client. Here we will present the extension of the scenario implemented in IoT_8. | + | This scenario is intended to be implemented using two BLE laboratory nodes. One of them is a server, while the second is a client. Here we will present the extension of the scenario implemented in [[en: |
==== Task to be implemented ==== | ==== Task to be implemented ==== | ||
**Task 1.** Implement a program that operates as the BLE server which advertises itself and allows us to connect to. After a successful connection, it handles the notify descriptor modification and sends the data automatically if notifications are enabled. | **Task 1.** Implement a program that operates as the BLE server which advertises itself and allows us to connect to. After a successful connection, it handles the notify descriptor modification and sends the data automatically if notifications are enabled. | ||
Line 18: | Line 18: | ||
==== Start ==== | ==== Start ==== | ||
- | You can use the simple client and server programs from IoT_8 as the starting point. | + | You can use the simple client and server programs from [[en: |
==== Steps ==== | ==== Steps ==== | ||
- | We will pass through the lab in a few steps. We will add the second characteristic to the example from lab IoT_8. We will configure this characteristic as notify/ | + | We will pass through the lab in a few steps. We will add the second characteristic to the example from lab [[en: |
=== Step 1 === | === Step 1 === | ||
- | We start with the program written during the laboratory IoT_8 by including the BLE2902.h library which handles the Client Characteristic Configuration Descriptor (CCCD). The descriptor of this type is used to enable or disable the notification and indication feature. | + | We start with the program written during the laboratory |
^ Descriptor UUID ^ Bits 1 and 0 ^ CCCD value ^ Function | ^ Descriptor UUID ^ Bits 1 and 0 ^ CCCD value ^ Function | ||
| 0x2902 | | 0x2902 | ||
Line 89: | Line 89: | ||
=== Step 4 === | === Step 4 === | ||
- | We have to extend the client software from scenario IoT_8 with some elements. Let's start with adding another remote characteristic which is responsible for receiving notifications. | + | We have to extend the client software from scenario |
<code c> | <code c> | ||
#define REMOTE_NOTIFY_CHARACTERISTIC_UUID " | #define REMOTE_NOTIFY_CHARACTERISTIC_UUID " |