Skip to content

Commit 32e26cc

Browse files
committed
fix(sensor_hub): add repository link to sensor_hub yml and update README example
1 parent d7baee5 commit 32e26cc

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

components/sensors/sensor_hub/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v0.1.1 - 2024-12-24
4+
5+
### Bug Fixes:
6+
7+
- Fix the missing repository link in the `sensor_hub` component yml and update the example in README.md
8+
39
## v0.1.0 - 2024-12-6
410

511
First release version

components/sensors/sensor_hub/README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,20 @@ To enable the ``sensor_hub`` to locate the sensor component, please refer to the
1717

1818
```c
1919
static imu_impl_t virtual_mpu6050_impl = {
20-
.name = "virtual_mpu6050",
21-
.sensor_type = IMU_ID,
2220
.init = virtual_imu_init,
2321
.deinit = virtual_imu_deinit,
2422
.test = virtual_imu_test,
2523
.acquire_acce = virtual_imu_acquire_acce,
2624
.acquire_gyro = virtual_imu_acquire_gyro,
27-
.sleep = virtual_imu_null_function,
28-
.wakeup = virtual_imu_null_function,
2925
};
3026

31-
void *virtual_mpu6050_detect(sensor_info_t *sensor_info)
32-
{
33-
sensor_info->snesor_type = IMU_ID;
34-
sensor_info->name = virtual_mpu6050_impl.name;
35-
return (void*)&virtual_mpu6050_impl;
36-
}
37-
38-
ESP_SENSOR_DETECT_FN(virtual_mpu6050_detect)
39-
{
40-
return virtual_mpu6050_detect(sensor_info);
41-
}
27+
SENSOR_HUB_DETECT_FN(IMU_ID, virtual_mpu6050, &virtual_mpu6050_impl);
4228
```
4329
4430
3. Modify the CMakeLists of the sensor driver to link the sensor registration function.
4531
4632
```cmake
47-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u virtual_mpu6050_detect")
33+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u virtual_imu_init")
4834
```
4935

5036
The `test_apps` of `sensor_hub` provide examples of virtual sensor registration, which you can refer to when registering your own sensor.

components/sensors/sensor_hub/idf_component.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
version: "0.1.0"
1+
version: "0.1.1"
22
description: Unified Framework for Sensor Management
3+
url: https://github.com/espressif/esp-iot-solution/tree/master/components/sensors/sensor_hub
4+
repository: https://github.com/espressif/esp-iot-solution.git
5+
documentation: https://docs.espressif.com/projects/esp-iot-solution/en/latest/sensors/sensor_hub.html
6+
issues: https://github.com/espressif/esp-iot-solution/issues
37
dependencies:
48
i2c_bus:
59
public: true

0 commit comments

Comments
 (0)