Jackson-gjh opened a new pull request, #3989:
URL: https://github.com/apache/nuttx-apps/pull/3989
## Summary
Add a reusable Apache NimBLE Environmental Sensing peripheral example.
## Features
- Advertises the standard Environmental Sensing service (`0x181a`).
- Exposes Temperature (`0x2a6e`) as signed little-endian hundredths of a
degree Celsius.
- Exposes Humidity (`0x2a6f`) as unsigned little-endian hundredths of a
percent.
- Supports GATT reads and notifications for both characteristics.
- Generates slowly changing sample values, so no sensor hardware is required.
- Separates GAP, GATT, and application code to make adaptation easier.
- Supports both CMake and Make application builds.
The example is intentionally named `nimble_bleess` rather than after the
ESP32-C6 validation board. It has no board-register or sensor-driver
dependency and can be reused by any NuttX target with a NimBLE peripheral
configuration.
## Usage
Enable `CONFIG_EXAMPLES_NIMBLE_BLEESS` and run:
```text
nsh> bleess
```
An optional numeric argument selects the HCI device:
```text
nsh> bleess 0
```
## Testing
Hardware and software:
- NuttX Apps base `b3d9d96bffab084de8f512e59abf2cc935124330`
- NuttX `43f7f34b9958283b4403789c9bc21df920fd3143`
- Apache NimBLE `31bb46e2`
- ESP32-C6 revision v0.2
- Windows Bleak client
The CMake build completed successfully and produced an ESP32-C6 image. The
image was flashed and the application advertised as `NuttX NimBLE ESS`.
The client discovered and connected to the device, found service `0x181a`,
read both characteristic values, subscribed to both CCC descriptors, and
received notifications from both characteristics:
```text
found=NuttX NimBLE ESS address=AC:EB:E6:C1:14:26
connected=True
temperature_read=24.08
humidity_read=50.16
humidity_notify=50.18
temperature_notify=24.09
result=PASS
```
Device output confirmed MTU exchange and both subscriptions:
```text
GAP connect: status=0
ATT MTU: conn=0 mtu=256
GATT subscribe: attr=16 notify=1 indicate=0
GATT subscribe: attr=19 notify=1 indicate=0
```
`nxstyle` passed for all C and header files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]