Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/sensors/sensor_hub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.1.3 - 2025-9-11

### Bug Fixes:

- Fix compilation issue of `iot_sensor_hub` when using c++

## v0.1.2 - 2025-3-12

### Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion components/sensors/sensor_hub/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.1.2"
version: "0.1.3"
description: Unified Framework for Sensor Management
url: https://github.com/espressif/esp-iot-solution/tree/master/components/sensors/sensor_hub
repository: https://github.com/espressif/esp-iot-solution.git
Expand Down
1 change: 0 additions & 1 deletion components/sensors/sensor_hub/include/hal/humiture_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ esp_err_t humiture_acquire(sensor_humiture_handle_t sensor, sensor_data_group_t
esp_err_t humiture_control(sensor_humiture_handle_t sensor, sensor_command_t cmd, void *args);

#ifdef __cplusplus
extern "C"
}
#endif

Expand Down
1 change: 0 additions & 1 deletion components/sensors/sensor_hub/include/hal/imu_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ esp_err_t imu_acquire(sensor_imu_handle_t sensor, sensor_data_group_t *data_grou
esp_err_t imu_control(sensor_imu_handle_t sensor, sensor_command_t cmd, void *args);

#ifdef __cplusplus
extern "C"
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ esp_err_t light_sensor_acquire(sensor_light_handle_t sensor, sensor_data_group_t
esp_err_t light_sensor_control(sensor_light_handle_t sensor, sensor_command_t cmd, void *args);

#ifdef __cplusplus
extern "C"
}
#endif

Expand Down
1 change: 0 additions & 1 deletion components/sensors/sensor_hub/include/iot_sensor_hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ esp_err_t iot_sensor_handler_register_with_type(sensor_type_t sensor_type, int32
esp_err_t iot_sensor_handler_unregister_with_type(sensor_type_t sensor_type, int32_t event_id, sensor_event_handler_instance_t context);

#ifdef __cplusplus
extern "C"
}
#endif
#endif
2 changes: 1 addition & 1 deletion components/sensors/sensor_hub/include/sensor_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ typedef struct {
typedef struct {
sensor_type_t type; /*!< sensor type */
sensor_driver_handle_t (*create)(bus_handle_t, const char *sensor_name, uint8_t addr); /*!< create a sensor */
esp_err_t (*delete)(sensor_driver_handle_t *); /*!< delete a sensor */
esp_err_t (*remove)(sensor_driver_handle_t *); /*!< delete a sensor */
esp_err_t (*acquire)(sensor_driver_handle_t, sensor_data_group_t *); /*!< acquire a group of sensor data */
esp_err_t (*control)(sensor_driver_handle_t, sensor_command_t cmd, void *args); /*!< modify the sensor configuration */
} iot_sensor_impl_t;
Expand Down
8 changes: 4 additions & 4 deletions components/sensors/sensor_hub/iot_sensor_hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static iot_sensor_impl_t s_sensor_impls[] = {
{
.type = HUMITURE_ID,
.create = humiture_create,
.delete = humiture_delete,
.remove = humiture_delete,
.acquire = humiture_acquire,
.control = humiture_control,
},
Expand All @@ -110,7 +110,7 @@ static iot_sensor_impl_t s_sensor_impls[] = {
{
.type = IMU_ID,
.create = imu_create,
.delete = imu_delete,
.remove = imu_delete,
.acquire = imu_acquire,
.control = imu_control,
},
Expand All @@ -119,7 +119,7 @@ static iot_sensor_impl_t s_sensor_impls[] = {
{
.type = LIGHT_SENSOR_ID,
.create = light_sensor_create,
.delete = light_sensor_delete,
.remove = light_sensor_delete,
.acquire = light_sensor_acquire,
.control = light_sensor_control,
},
Expand Down Expand Up @@ -567,7 +567,7 @@ esp_err_t iot_sensor_delete(sensor_handle_t p_sensor_handle)
ESP_LOGW(TAG, "sensor set power failed ret = %s", esp_err_to_name(ret));
}

ret = sensor->impl->delete (&sensor->driver_handle);
ret = sensor->impl->remove(&sensor->driver_handle);
SENSOR_CHECK(ret == ESP_OK && sensor->driver_handle == NULL, "sensor driver delete failed", ret);

/*free the resource then set handle to NULL*/
Expand Down