feat(sensors): modernize sensor drivers and streaming#212
feat(sensors): modernize sensor drivers and streaming#212DennisMoschina wants to merge 1 commit into
Conversation
|
This PR is a sensor pipeline modernization. The main idea is to remove the old central zbus-based sensor data path and make sensors write directly to SD/BLE through a new layer (named: sensor_sink). It also updates several sensor drivers to use FIFO batching, improves power/shutdown behavior, removes some old/unused code, and adds a Zephyr shell interface for sensor testing. Main change: Sensor -> sensor_queue -> SensorManager publisher thread -> sensor_chan -> SDLogger / Bluetooth The new intended path is: Sensor -> sensor_sink_put() -> SDLogger and/or Bluetooth GATT queue This simplifies the path and removes the SensorManager publisher thread. SensorManager is now mostly responsible for starting/stopping sensors and managing SD/BLE config state, not forwarding every sensor sample. However, there is a possible incomplete migration: SDLogger.cpp still declares/observes sensor_chan, but the PR removes the SensorManager definition of sensor_chan. This should be checked because it can cause build issues. SensorManager: One possible issue: start_sensor_manager() clears sd_sensors and ble_sensors. Since SD sensor tracking is updated before start_sensor_manager() is called, the first SD sensor may get removed from tracking immediately. sensor_service / BLE: A risk here is that the new notification logic appears to reuse shared/static sensor_data memory with a semaphore, instead of giving every BLE notification its own independent payload copy. This should be checked for possible overwrite/race problems when multiple notifications are sent. sensor_sink: Several sensors ignore the return value from sensor_sink_put(), so SD/BLE failures may silently drop samples or only appear in debug counters. Driver / sampling changes: BMX160 / IMU: BMP388 / Barometer: MAXM86161 / PPG: MLX90632 / Temperature: Microphone: sensor_shell: |
Draft PR extracted from thandal/open-earable-2 (see #183). Modernizes the sensor stack with Bosch BMI160 support, sensor sink plumbing, diagnostics, metadata cleanup, and polling/performance fixes.