From e7b7c88ae213da190a4fcfef0fcd639fab4f4bba Mon Sep 17 00:00:00 2001 From: xiayifan Date: Sat, 28 Dec 2024 11:25:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E9=9C=80=E6=B1=82=E3=80=91?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=9E=8D=E5=90=88=E5=8E=8B=E5=8A=9B=E4=BC=A0?= =?UTF-8?q?=E6=84=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiayifan --- frameworks/js/napi/src/sensor_napi_utils.cpp | 3 ++- interfaces/inner_api/sensor_agent_type.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frameworks/js/napi/src/sensor_napi_utils.cpp b/frameworks/js/napi/src/sensor_napi_utils.cpp index 040dbb29..66d14d78 100644 --- a/frameworks/js/napi/src/sensor_napi_utils.cpp +++ b/frameworks/js/napi/src/sensor_napi_utils.cpp @@ -187,7 +187,8 @@ std::map> g_sensorAttributeList = { { SENSOR_TYPE_ID_WEAR_DETECTION, { "value" } }, { SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, { "x", "y", "z", "biasX", "biasY", "biasZ" } }, { SENSOR_TYPE_ID_COLOR, { "lightIntensity", "colorTemperature" } }, - { SENSOR_TYPE_ID_SAR, { "absorptionRatio" } } + { SENSOR_TYPE_ID_SAR, { "absorptionRatio" } }, + { SENSOR_TYPE_ID_FUSION_PRESSURE, { "fusionPressure" } }, }; std::map g_convertfuncList = { diff --git a/interfaces/inner_api/sensor_agent_type.h b/interfaces/inner_api/sensor_agent_type.h index c975813c..55abb2a0 100644 --- a/interfaces/inner_api/sensor_agent_type.h +++ b/interfaces/inner_api/sensor_agent_type.h @@ -102,6 +102,7 @@ typedef enum SensorTypeId { SENSOR_TYPE_ID_WEAR_DETECTION = 280, /**< Wear detection sensor */ SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED = 281, /**< Uncalibrated acceleration sensor */ SENSOR_TYPE_ID_RPC = 282, /**< Radio power control sensor */ + SENSOR_TYPE_ID_FUSION_PRESSURE = 283, /**< Fusion pressure sensor */ SENSOR_TYPE_ID_MAX = 30, /**< Maximum number of sensor type IDs*/ } SensorTypeId; @@ -519,6 +520,10 @@ typedef struct SensorActiveInfo { int64_t maxReportDelayNs = -1; /**< Maximum Report Delay, in ns */ } SensorActiveInfo; +typedef struct FusionPressureData { + float fusionPressure = 0.0; +} FusionPressureData; + typedef void (*SensorActiveInfoCB)(SensorActiveInfo &sensorActiveInfo); #ifdef __cplusplus -- Gitee From 5cee557492f678977c1a3c9e9300a77363dd16d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=98=93=E5=87=A1?= Date: Thu, 2 Jan 2025 11:36:13 +0000 Subject: [PATCH 2/2] update interfaces/inner_api/sensor_agent_type.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 夏易凡 --- interfaces/inner_api/sensor_agent_type.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/inner_api/sensor_agent_type.h b/interfaces/inner_api/sensor_agent_type.h index 55abb2a0..5d57cb2e 100644 --- a/interfaces/inner_api/sensor_agent_type.h +++ b/interfaces/inner_api/sensor_agent_type.h @@ -103,7 +103,7 @@ typedef enum SensorTypeId { SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED = 281, /**< Uncalibrated acceleration sensor */ SENSOR_TYPE_ID_RPC = 282, /**< Radio power control sensor */ SENSOR_TYPE_ID_FUSION_PRESSURE = 283, /**< Fusion pressure sensor */ - SENSOR_TYPE_ID_MAX = 30, /**< Maximum number of sensor type IDs*/ + SENSOR_TYPE_ID_MAX = 300, /**< Maximum number of sensor type IDs*/ } SensorTypeId; /** @@ -521,7 +521,7 @@ typedef struct SensorActiveInfo { } SensorActiveInfo; typedef struct FusionPressureData { - float fusionPressure = 0.0; + float fusionPressure = 0.0f; } FusionPressureData; typedef void (*SensorActiveInfoCB)(SensorActiveInfo &sensorActiveInfo); -- Gitee