From 881c05d550e19de21ab8322d9de6e5f88ed2a3f1 Mon Sep 17 00:00:00 2001 From: hui1975 Date: Thu, 19 Jan 2023 09:54:44 +0000 Subject: [PATCH 1/2] =?UTF-8?q?sensor=E4=BD=8E=E5=8A=9F=E8=80=97=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hui1975 Change-Id: Id5661972557046344aeed8881d09eb3b0a1e717a --- interfaces/native/include/sensor_agent.h | 9 +++++++++ interfaces/native/include/sensor_agent_type.h | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/interfaces/native/include/sensor_agent.h b/interfaces/native/include/sensor_agent.h index ead362c9..d7c609ee 100755 --- a/interfaces/native/include/sensor_agent.h +++ b/interfaces/native/include/sensor_agent.h @@ -39,6 +39,7 @@ #define SENSOR_AGENT_H #include "sensor_agent_type.h" +#include "i_sensor_status_callback.h" #ifdef __cplusplus #if __cplusplus @@ -128,6 +129,14 @@ int32_t DeactivateSensor(int32_t sensorTypeId, const SensorUser *user); */ int32_t SetMode(int32_t sensorTypeId, const SensorUser *user, int32_t mode); +int32_t SuspendSensors(int32_t pid); + +int32_t ResumeSensors(int32_t pid); + +int32_t GetAppSensors(int32_t pid, AppSensorInfo **appSensorInfos, int32_t *count); + +int32_t RegisterCallback(OHOS::sptr callback); + #ifdef __cplusplus #if __cplusplus } diff --git a/interfaces/native/include/sensor_agent_type.h b/interfaces/native/include/sensor_agent_type.h index 37b0de0e..e030fbc1 100644 --- a/interfaces/native/include/sensor_agent_type.h +++ b/interfaces/native/include/sensor_agent_type.h @@ -395,6 +395,14 @@ typedef struct WearDetectionData { float value; } WearDetectionData; +typedef struct AppSensorInfo { + int32_t pid; /**< PID */ + uint32_t sensorId; /**< Sensor ID */ + bool isActive; /**< Sensor status */ + int64_t samplingPeriodNs; /**< Sample period, in ns */ + int64_t maxReportDelayNs; /**< Maximum Report Delay, in ns */ +} AppSensorInfo; + #ifdef __cplusplus #if __cplusplus } -- Gitee From 536def5f31b94e552db506a1d0bf6aa977815ed1 Mon Sep 17 00:00:00 2001 From: hui1975 Date: Thu, 19 Jan 2023 09:58:24 +0000 Subject: [PATCH 2/2] =?UTF-8?q?sensor=E4=BD=8E=E5=8A=9F=E8=80=97=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hui1975 Change-Id: I41029d4bc8c3cf867ae0e88243b79a367ab08779 --- interfaces/native/include/sensor_agent_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/native/include/sensor_agent_type.h b/interfaces/native/include/sensor_agent_type.h index e030fbc1..72770bcb 100644 --- a/interfaces/native/include/sensor_agent_type.h +++ b/interfaces/native/include/sensor_agent_type.h @@ -397,7 +397,7 @@ typedef struct WearDetectionData { typedef struct AppSensorInfo { int32_t pid; /**< PID */ - uint32_t sensorId; /**< Sensor ID */ + int32_t sensorId; /**< Sensor ID */ bool isActive; /**< Sensor status */ int64_t samplingPeriodNs; /**< Sample period, in ns */ int64_t maxReportDelayNs; /**< Maximum Report Delay, in ns */ -- Gitee