|
| 1 | +.. zephyr:code-sample:: stm32_ble_hr_802154_echo_client |
| 2 | + :name: BLE HR - 802154 Echo client (advanced) |
| 3 | + |
| 4 | + Implement a Bluetooth |reg| Energy Heart Rate - IEEE 802154 client. |
| 5 | + The BLE Heart Rate (HR) GATT Service generates dummy heart-rate |
| 6 | + values and the 802154 echo client sends IP packets, waits for data |
| 7 | + to be sent back, and verifies it. |
| 8 | + |
| 9 | +Overview |
| 10 | +******** |
| 11 | + |
| 12 | +The sample application implements a concurrent mode BLE - IEEE 802.15.4. |
| 13 | +Both wireless protocols Bluetooth |reg| Energy and IEEE 802.15.4 coexist : |
| 14 | +the application supports simultaneously one Bluetooth |reg| Energy connection |
| 15 | +and one IEEE 802.15.4 connection. |
| 16 | +The 802.15.4 part implements UDP client that will send IPv6 packets, |
| 17 | +wait for the data to be sent back, and then verify it matches |
| 18 | +the data that was sent. |
| 19 | +The BLE part exposes the HR (Heart Rate) GATT Service. Once a device |
| 20 | +connects it will generate dummy heart-rate values. |
| 21 | + |
| 22 | +The source code for this sample application can be found at: |
| 23 | +:zephyr_file:`samples/boards/st/bluetooth/ble_hr_802154_echo_client`. |
| 24 | + |
| 25 | +The IEEE 802.15.4 config of the sample enables support for native |
| 26 | +IEEE 802.15.4 connectivity. |
| 27 | +Note that by default IEEE 802.15.4 L2 uses unacknowledged communication. |
| 28 | +To improve connection reliability, acknowledgments can be enabled with |
| 29 | +shell command: ``ieee802154 ack set``. |
| 30 | + |
| 31 | +Environment Setup |
| 32 | +***************** |
| 33 | + |
| 34 | +This sample has been tested on the STMicroelectonics NUCLEO-WBA65RI board |
| 35 | +(nucleo_wba65ri). |
| 36 | +This board interacts simultaneously with another board embedding an |
| 37 | +echo-server sample with the 802.15.4 overlay (nucleo_wba65ri) and a |
| 38 | +smartphone supporting BLE Heart Rate. |
| 39 | + |
| 40 | +Building and Running |
| 41 | +******************** |
| 42 | + |
| 43 | +Build sample application like this: |
| 44 | + |
| 45 | +.. zephyr-app-commands:: |
| 46 | + :zephyr-app: samples/boards/st/bluetooth/ble_hr_802154_echo_client |
| 47 | + :board: nucleo_wba65ri |
| 48 | + :goals: build |
| 49 | + :compact: |
| 50 | + |
| 51 | +The LED 1 toggles while application is BLE advertising. Once a remote device |
| 52 | +connects, the LED 1 turns ON and application will generate dummy heart-rate values. |
| 53 | +Once remote device disconnects, the application restarts BLE advertising and LED 1 |
| 54 | +toggles. |
| 55 | + |
| 56 | +Simultaneously, IEEE 802.15.4 feature is enabled. To validate behavior, use another |
| 57 | +board that will be used as a remote server. |
| 58 | +This can be done using echo-server sample application with :file:`overlay-802154.conf`. |
| 59 | + |
| 60 | +.. zephyr-app-commands:: |
| 61 | + :zephyr-app: samples/net/sockets/echo_server |
| 62 | + :board: nucleo_wba65ri |
| 63 | + :gen-args: -DEXTRA_CONF_FILE=overlay-802154.conf |
| 64 | + :goals: build flash |
| 65 | + :compact: |
| 66 | + |
| 67 | +Once both devices are connected, local device will send IPv6 packets, wait for |
| 68 | +the data to be sent back from the remote echo-server device, and then verify it |
| 69 | +matches the data that was sent. |
0 commit comments