CAF: Sensor manager
The sensor manager sample demonstrates the functionality of the CAF: Sensor manager module.
The sample supports the following development kits:
The sample provides stub input data using Sensor stub driver.
The input data simulates acceleration along the X, Y, and Z axes.
Whenever new data is generated, the CAF: Sensor manager module generates the appropriate
sensor_event instances that include the generated data.
The data from the events is then passed to the CAF: Sensor data aggregator module.
When the aggregator’s buffer is full, the application sends aggregated data to the workload simulator module (
The workload simulator is a custom module used by this sample only.
This module handles the data received from the CAF: Sensor data aggregator module, simulates workload on data using
k_busy_wait() and notifies the aggregator module when the aggregator buffer can be freed.
If you are running this sample on an SoC with multiple cores, the workload simulator module (
workload_sim) is placed on the second core.
All communication between the cores is done using Event Manager Proxy and Zephyr subsystem
This sample can be found under
samples/caf_sensor_manager in the nRF Connect SDK folder structure.
To build the sample with Visual Studio Code, follow the steps listed on the How to build an application page in the nRF Connect for VS Code extension documentation. See Building and programming an application for other building and programming scenarios and Testing and debugging an application for general information about testing and debugging in the nRF Connect SDK.
After programming the sample to your development kit, test it by performing the following steps:
Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.
Reset the kit.
Observe that output similar to the following is logged on UART:
* Booting Zephyr OS build v3.0.99-ncs1-2759-g07737b0b09e7 * [00:00:00.257,232] <inf> main: Event manager initialized [00:00:00.258,239] <inf> event_proxy_init: Event proxy remote added [00:00:00.259,948] <inf> event_proxy_init: Event proxy sensor_data_aggregator_event registered [00:00:00.260,009] <inf> event_proxy_init: Event manager proxy started [00:00:00.260,284] <inf> event_proxy_init: All remotes ready [00:00:00.260,345] <inf> app_event_manager: e:module_state_event module:main state:READY [00:00:00.260,742] <inf> app_event_manager: e:sensor_data_aggregator_event Send sensor buffer desc address: 0x100e28a [00:00:00.260,894] <inf> app_event_manager: e: sensor_data_aggregator_release_buffer_event [00:00:02.260,620] <inf> app_event_manager: e:sensor_data_aggregator_event Send sensor buffer desc address: 0x100e28a [00:00:02.260,864] <inf> app_event_manager: e: sensor_data_aggregator_release_buffer_event
This sample uses the following nRF Connect SDK libraries:
This sample uses the following nRF Connect SDK drivers:
In addition, it uses the following Zephyr subsystems: