diff --git a/frameworks/include/sensor_agent.h b/frameworks/include/sensor_agent.h
deleted file mode 100755
index b70c576888df5f9c6d2c6d8b91f60227649be723..0000000000000000000000000000000000000000
--- a/frameworks/include/sensor_agent.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @addtogroup PanSensor
- * @{
- *
- * @brief Provides standard open APIs for you to use common capabilities of sensors.
- *
- * For example, you can call these APIs to obtain sensor information,
- * subscribe to or unsubscribe from sensor data, enable or disable a sensor,
- * and set the sensor data reporting mode.
- *
- * @since 5
- */
-
-/**
- * @file sensor_agent.h
- *
- * @brief Declares common APIs for sensor management, such as APIs for subscribing to
- * and obtaining sensor data, enabling a sensor, and setting the sensor data reporting mode.
- *
- * @since 5
- */
-
-#ifndef SENSOR_AGENT_H
-#define SENSOR_AGENT_H
-
-#include "hilog/log.h"
-#include "sensor_agent_type.h"
-
-#undef LOG_TAG
-#define LOG_TAG "SENSOR_LITE"
-
-#ifdef __cplusplus
-#if __cplusplus
-extern "C" {
-#endif
-#endif
-
-/**
- * @brief Obtains information about all sensors in the system.
- *
- * @param sensorInfo Indicates the double pointer to the information about all sensors in the system.
- * For details, see {@link SensorInfo}.
- * @param count Indicates the pointer to the total number of sensors in the system.
- * @return Returns 0 if the information is obtained; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t GetAllSensors(SensorInfo **sensorInfo, int32_t *count);
-
-/**
- * @brief Subscribes to sensor data. The system will report the obtained sensor data to the subscriber.
- *
- * @param sensorTypeId Indicates the ID of a sensor type. For details, see {@link SensorTypeId}.
- * @param user Indicates the pointer to the sensor subscriber that requests sensor data. For details,
- * see {@link SensorUser}. A subscriber can obtain data from only one sensor.
- * @return Returns 0 if the subscription is successful; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t SubscribeSensor(int32_t sensorTypeId, SensorUser *user);
-
-/**
- * @brief Unsubscribes from sensor data.
- *
- * @param sensorTypeId Indicates the ID of a sensor type. For details, see {@link SensorTypeId}.
- * @param user Indicates the pointer to the sensor subscriber that requests sensor data.
- * For details, see {@link SensorUser}. A subscriber can obtain data from only one sensor.
- * @return Returns 0 if the unsubscription is successful; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t UnsubscribeSensor(int32_t sensorTypeId, SensorUser *user);
-
-/**
- * @brief Sets the data sampling interval and data reporting interval for the specified sensor.
- *
- * @param sensorTypeId Indicates the ID of a sensor type. For details, see {@link SensorTypeId}.
- * @param user Indicates the pointer to the sensor subscriber that requests sensor data.
- * For details, see {@link SensorUser}. A subscriber can obtain data from only one sensor.
- * @param samplingInterval Indicates the sensor data sampling interval to set, in nanoseconds.
- * @param reportInterval Indicates the sensor data reporting interval, in nanoseconds.
- * @return Returns 0 if the setting is successful; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t SetBatch(int32_t sensorTypeId, SensorUser *user, int64_t samplingInterval, int64_t reportInterval);
-
-/**
- * @brief Enables the sensor that has been subscribed to. The subscriber can obtain the sensor data
- * only after the sensor is enabled.
- *
- * @param sensorTypeId Indicates the ID of a sensor type. For details, see {@link SensorTypeId}.
- * @param user Indicates the pointer to the sensor subscriber that requests sensor data.
- * For details, see {@link SensorUser}. A subscriber can obtain data from only one sensor.
- * @return Returns 0 if the sensor is successfully enabled; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t ActivateSensor(int32_t sensorTypeId, SensorUser *user);
-
-/**
- * @brief Disables an enabled sensor.
- *
- * @param sensorTypeId Indicates the ID of a sensor type. For details, see {@link SensorTypeId}.
- * @param user Indicates the pointer to the sensor subscriber that requests sensor data.
- * For details, see {@link SensorUser}. A subscriber can obtain data from only one sensor.
- * @return Returns 0 if the sensor is successfully disabled; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t DeactivateSensor(int32_t sensorTypeId, SensorUser *user);
-
-/**
- * @brief Sets the data reporting mode for the specified sensor.
- *
- * @param sensorTypeId Indicates the ID of a sensor type. For details, see {@link SensorTypeId}.
- * @param user Indicates the pointer to the sensor subscriber that requests sensor data.
- * For details, see {@link SensorUser}. A subscriber can obtain data from only one sensor.
- * @param mode Indicates the data reporting mode to set. For details, see {@link SensorMode}.
- * @return Returns 0 if the sensor data reporting mode is successfully set; returns a non-zero value otherwise.
- *
- * @since 5
- */
-int32_t SetMode(int32_t sensorTypeId, SensorUser *user, int32_t mode);
-
-#ifdef __cplusplus
-#if __cplusplus
-}
-#endif
-#endif
-#endif /* SENSOR_AGENT_H */
-/** @} */
\ No newline at end of file
diff --git a/frameworks/include/sensor_agent_type.h b/frameworks/include/sensor_agent_type.h
deleted file mode 100755
index 972cc1dba1ded1e525210d707ce7e5a1aaf7b8ed..0000000000000000000000000000000000000000
--- a/frameworks/include/sensor_agent_type.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @addtogroup PanSensor
- * @{
- *
- * @brief Provides standard open APIs for you to use common capabilities of sensors.
- *
- * For example, you can call these APIs to obtain sensor information,
- * subscribe to or unsubscribe from sensor data, enable or disable a sensor,
- * and set the sensor data reporting mode.
- *
- * @since 5
- */
-
-/**
- * @file sensor_agent_type.h
- *
- * @brief Defines the basic data used by the sensor agent to manage sensors.
- *
- * @since 5
- */
-
-#ifndef SENSOR_AGENT_TYPE_H
-#define SENSOR_AGENT_TYPE_H
-
-#include
-
-#ifdef __cplusplus
-#if __cplusplus
-extern "C" {
-#endif
-#endif
-
-#define SENSOR_ERROR_UNKNOWN (-1)
-#define SENSOR_ERROR_INVALID_ID (-2)
-#define SENSOR_ERROR_INVALID_PARAM (-3)
-#define SENSOR_OK 0
-#ifndef SENSOR_NAME_MAX_LEN
-/** Maximum length of the sensor name */
-#define SENSOR_NAME_MAX_LEN 16
-#endif /* SENSOR_NAME_MAX_LEN */
-
-#ifndef SENSOR_USER_DATA_SIZE
-/** Size of sensor data */
-#define SENSOR_USER_DATA_SIZE 104
-#endif /* SENSOR_USER_DATA_SIZE */
-
-#ifndef VERSION_MAX_LEN
-/** Maximum length of the sensor version */
-#define VERSION_MAX_LEN 16
-#endif /* SENSOR_USER_DATA_SIZE */
-
-/**
- * @brief Enumerates sensor types.
- *
- * @since 5
- */
-typedef enum SensorTypeId {
- SENSOR_TYPE_ID_NONE = 0, /**< None */
- SENSOR_TYPE_ID_ACCELEROMETER = 1, /**< Acceleration sensor */
- SENSOR_TYPE_ID_GYROSCOPE = 2, /**< Gyroscope sensor */
- SENSOR_TYPE_ID_PHOTOPLETHYSMOGRAPH = 3, /**< Photoplethysmography sensor */
- SENSOR_TYPE_ID_ELECTROCARDIOGRAPH = 4, /**< Electrocardiogram (ECG) sensor */
- SENSOR_TYPE_ID_AMBIENT_LIGHT = 5, /**< Ambient light sensor */
- SENSOR_TYPE_ID_MAGNETIC_FIELD = 6, /**< Magnetic field sensor */
- SENSOR_TYPE_ID_CAPACITIVE = 7, /**< Capacitive sensor */
- SENSOR_TYPE_ID_BAROMETER = 8, /**< Barometric pressure sensor */
- SENSOR_TYPE_ID_TEMPERATURE = 9, /**< Temperature sensor */
- SENSOR_TYPE_ID_HALL = 10, /**< Hall effect sensor */
- SENSOR_TYPE_ID_GESTURE = 11, /**< Gesture sensor */
- SENSOR_TYPE_ID_PROXIMITY = 12, /**< Proximity sensor */
- SENSOR_TYPE_ID_HUMIDITY = 13, /**< Humidity sensor */
- SENSOR_TYPE_ID_PHYSICAL_MAX = 0xFF, /**< Maximum type ID of a physical sensor */
- SENSOR_TYPE_ID_ORIENTATION = 256, /**< Orientation sensor */
- SENSOR_TYPE_ID_GRAVITY = 257, /**< Gravity sensor */
- SENSOR_TYPE_ID_LINEAR_ACCELERATION = 258, /**< Linear acceleration sensor */
- SENSOR_TYPE_ID_ROTATION_VECTOR = 259, /**< Rotation vector sensor */
- SENSOR_TYPE_ID_AMBIENT_TEMPERATURE = 260, /**< Ambient temperature sensor */
- SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED = 261, /**< Uncalibrated magnetic field sensor */
- SENSOR_TYPE_ID_GAME_ROTATION_VECTOR = 262, /**< Game rotation vector sensor */
- SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED = 263, /**< Uncalibrated gyroscope sensor */
- SENSOR_TYPE_ID_SIGNIFICANT_MOTION = 264, /**< Significant motion sensor */
- SENSOR_TYPE_ID_PEDOMETER_DETECTION = 265, /**< Pedometer detection sensor */
- SENSOR_TYPE_ID_PEDOMETER = 266, /**< Pedometer sensor */
- SENSOR_TYPE_ID_GEOMAGNETIC_ROTATION_VECTOR = 277, /**< Geomagnetic rotation vector sensor */
- SENSOR_TYPE_ID_HEART_RATE = 278, /**< Heart rate sensor */
- SENSOR_TYPE_ID_DEVICE_ORIENTATION = 279, /**< Device orientation sensor */
- SENSOR_TYPE_ID_WEAR_DETECTION = 280, /**< Wear detection sensor */
- SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED = 281, /**< Uncalibrated acceleration sensor */
- SENSOR_TYPE_ID_MAX = 30, /**< Maximum number of sensor type IDs*/
-} SensorTypeId;
-
-/**
- * @brief Defines sensor information.
- *
- * @since 5
- */
-typedef struct SensorInfo {
- char sensorName[SENSOR_NAME_MAX_LEN]; /**< Sensor name */
- char vendorName[SENSOR_NAME_MAX_LEN]; /**< Sensor vendor */
- char firmwareVersion[VERSION_MAX_LEN]; /**< Sensor firmware version */
- char hardwareVersion[VERSION_MAX_LEN]; /**< Sensor hardware version */
- int32_t sensorTypeId; /**< Sensor type ID */
- int32_t sensorId; /**< Sensor ID */
- float maxRange; /**< Maximum measurement range of the sensor */
- float precision; /**< Sensor accuracy */
- float power; /**< Sensor power */
-} SensorInfo;
-
-/**
- * @brief Defines the data reported by the sensor.
- *
- * @since 5
- */
-typedef struct SensorEvent {
- int32_t sensorTypeId; /**< Sensor type ID */
- int32_t version; /**< Sensor algorithm version */
- int64_t timestamp; /**< Time when sensor data was reported */
- uint32_t option; /**< Sensor data options, including the measurement range and accuracy */
- int32_t mode; /**< Sensor data reporting mode (described in {@link SensorMode}) */
- uint8_t *data; /**< Sensor data */
- uint32_t dataLen; /**< Sensor data length */
-} SensorEvent;
-
-/**
- * @brief Defines the callback for data reporting by the sensor agent.
- *
- * @since 5
- */
-typedef void (*RecordSensorCallback)(SensorEvent *event);
-
-/**
- * @brief Defines a reserved field for the sensor data subscriber.
- *
- * @since 5
- */
-typedef struct UserData {
- char userData[SENSOR_USER_DATA_SIZE]; /**< Reserved for the sensor data subscriber */
-} UserData;
-
-/**
- * @brief Defines information about the sensor data subscriber.
- *
- * @since 5
- */
-typedef struct SensorUser {
- char name[SENSOR_NAME_MAX_LEN]; /**< Name of the sensor data subscriber */
- RecordSensorCallback callback; /**< Callback for reporting sensor data */
- UserData *userData; /**< Reserved field for the sensor data subscriber */
-} SensorUser;
-
-/**
- * @brief Enumerates data reporting modes of sensors.
- *
- * @since 5
- */
-typedef enum SensorMode {
- SENSOR_DEFAULT_MODE = 0, /**< Default data reporting mode */
- SENSOR_REALTIME_MODE = 1, /**< Real-time data reporting mode to report a group of data each time */
- SENSOR_ON_CHANGE = 2, /**< Real-time data reporting mode to report data upon status changes */
- SENSOR_ONE_SHOT = 3, /**< Real-time data reporting mode to report data only once */
- SENSOR_FIFO_MODE = 4, /**< FIFO-based data reporting mode to report data based on the BatchCnt setting */
-} SensorMode;
-
-#ifdef __cplusplus
-#if __cplusplus
-}
-#endif
-#endif
-#endif /* SENSOR_AGENT_TYPE_H */
-/** @} */
\ No newline at end of file
diff --git a/frameworks/src/BUILD.gn b/frameworks/src/BUILD.gn
index 51741057f9add256ec236e90a43c22e36eef8c46..57ef1b2e777ad8158f0651905fcd2fbf1a3f3fd0 100644
--- a/frameworks/src/BUILD.gn
+++ b/frameworks/src/BUILD.gn
@@ -38,6 +38,7 @@ shared_library("sensor_client") {
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/communication/broadcast",
"//foundation/systemabilitymgr/samgr_lite/samgr/source",
"//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
+ "//base/sensors/sensor_lite/interfaces/kits/native/include",
"//base/sensors/sensor_lite/services/include",
]
diff --git a/interfaces/kits/native/include/sensor_agent.h b/interfaces/kits/native/include/sensor_agent.h
old mode 100755
new mode 100644
diff --git a/interfaces/kits/native/include/sensor_agent_type.h b/interfaces/kits/native/include/sensor_agent_type.h
index c4d8c60b219c1bc097e2255a14ec1b4991e3c3ce..34ae9f6c34fe45db1ac999d6e0cb7ade7f134200 100755
--- a/interfaces/kits/native/include/sensor_agent_type.h
+++ b/interfaces/kits/native/include/sensor_agent_type.h
@@ -45,6 +45,10 @@ extern "C" {
#endif
#endif
+#define SENSOR_ERROR_UNKNOWN (-1)
+#define SENSOR_ERROR_INVALID_ID (-2)
+#define SENSOR_ERROR_INVALID_PARAM (-3)
+#define SENSOR_OK 0
#ifndef SENSOR_NAME_MAX_LEN
/** Maximum length of the sensor name */
#define SENSOR_NAME_MAX_LEN 16
@@ -170,7 +174,7 @@ typedef enum SensorMode {
SENSOR_ON_CHANGE = 2, /**< Real-time data reporting mode to report data upon status changes */
SENSOR_ONE_SHOT = 3, /**< Real-time data reporting mode to report data only once */
SENSOR_FIFO_MODE = 4, /**< FIFO-based data reporting mode to report data based on the BatchCnt setting */
- SENSOR_MODE_MAX, /**< Maximum sensor data reporting mode */
+ SENSOR_MAX_MODE, /**< Maximum sensor data reporting mode */
} SensorMode;
#ifdef __cplusplus
diff --git a/services/BUILD.gn b/services/BUILD.gn
index a70fa4c7ca6d2af7511b4c1f0c4a7f64b760484b..16917be9e54b7f138d1247894ae439066e1bc627 100644
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -34,6 +34,7 @@ executable("sensor_service") {
"//foundation/communication/ipc/services/dbinder/c/include",
"//drivers/peripheral/sensor/interfaces/include",
"//base/sensors/sensor_lite/frameworks/include",
+ "//base/sensors/sensor_lite/interfaces/kits/native/include",
]
deps = [