zephyr/samples/bluetooth/bthome_sensor_template
Nirav Agrawal 767772aad1 samples: bluetooth: fix adv_update error in bthome_sensor_template
- "bt_le_adv_update_data()" func calls just after bt_enable() call
 without completion of bt_ready() which is called as part of worker
 thread within init_work() causes issue where bluetooth controller
 has not been initialized and provides cb to app before app requests
 advertise_update to the stack.
- remove bt_ready() func and place content within main() post
 bt_enable() fixes this issue.

Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
2025-05-27 10:29:28 +02:00
..
src samples: bluetooth: fix adv_update error in bthome_sensor_template 2025-05-27 10:29:28 +02:00
CMakeLists.txt
prj.conf
README.rst doc: samples: Adopt code-sample-category across tree 2024-09-23 12:00:00 +02:00

.. zephyr:code-sample:: bluetooth_bthome_sensor_template
   :name: BTHome sensor template
   :relevant-api: bluetooth

   Implement a BTHome sensor.

Overview
********

This code sample provides a template for implementing a `BTHome <https://bthome.io/>`_ sensor.

Requirements
************

* A board with Bluetooth LE support
* A BTHome compatible listener, for example `Home Assistant <https://www.home-assistant.io/>`_ with the BTHome integration running.

Building and Running
********************

This sample can be found under :zephyr_file:`samples/bluetooth/bthome_sensor_template` in the Zephyr tree.

See :zephyr:code-sample-category:`bluetooth` samples for details.

When the sample is running, navigate to Devices & Services under settings in Home
Assistant. There you will be asked to configure the BTHome sensor if everything
went well.