diff --git a/frameworks/include/sensor_agent_proxy.h b/frameworks/include/sensor_agent_proxy.h old mode 100755 new mode 100644 index 73f73dfca7de6b29af191d561062de5b9f606c47..96b2b32a55f3ab98defb2a52669e856d9cc911ab --- a/frameworks/include/sensor_agent_proxy.h +++ b/frameworks/include/sensor_agent_proxy.h @@ -21,11 +21,8 @@ #include #include #include "liteipc_adapter.h" -#include #include "samgr_lite.h" -#include "sensor_agent.h" #include "sensor_agent_type.h" -#include "sensor_service.h" #include "serializer.h" #ifdef __cplusplus diff --git a/frameworks/src/sensor_agent_proxy.c b/frameworks/src/sensor_agent_proxy.c old mode 100755 new mode 100644 index a04b8de1e062c19bf0bc66910ed430188a4c3fb9..f528c892562745e44ff084e30a4cc53562159e13 --- a/frameworks/src/sensor_agent_proxy.c +++ b/frameworks/src/sensor_agent_proxy.c @@ -15,9 +15,11 @@ #include "sensor_agent_proxy.h" -#include +#include +#include #include -#include +#include "sensor_agent.h" +#include "sensor_service.h" static SensorInfo *g_sensorLists; static SensorEvent *g_sensorEvent; @@ -187,7 +189,7 @@ int32_t Notify(IOwner owner, int32_t code, IpcIo *reply) } } -void DispatchData(const SensorEvent *sensorEvent) +void DispatchData(SensorEvent *sensorEvent) { HILOG_DEBUG(HILOG_MODULE_APP, "%s begin", __func__); if (sensorEvent == NULL) { diff --git a/services/include/sensor_service_impl.h b/services/include/sensor_service_impl.h old mode 100755 new mode 100644 index 701e7129f11167695c342e45a19a3c315c85f42b..aa3cbc8d258402c0f20d8d6ec8ce8c2a476fcf47 --- a/services/include/sensor_service_impl.h +++ b/services/include/sensor_service_impl.h @@ -52,7 +52,7 @@ int32_t SubscribeSensorInvoke(SensorFeatureApi *defaultApi, IpcIo *req, IpcIo *r int32_t UnsubscribeSensorInvoke(SensorFeatureApi *defaultApi, IpcIo *req, IpcIo *reply); int32_t SetModeInvoke(SensorFeatureApi *defaultApi, IpcIo *req, IpcIo *reply); int32_t SetOptionInvoke(SensorFeatureApi *defaultApi, IpcIo *req, IpcIo *reply); -void SetSvcIdentity(const IpcIo *req, const IpcIo *reply); +void SetSvcIdentity(IpcIo *req, const IpcIo *reply); #ifdef __cplusplus #if __cplusplus } diff --git a/services/src/proc.c b/services/src/proc.c old mode 100755 new mode 100644 index 7eceddba6bd6c093396bd612c739f4b36cb536de..a39b303a139714bda88e92b67483899f86ecb0a9 --- a/services/src/proc.c +++ b/services/src/proc.c @@ -13,7 +13,8 @@ * limitations under the License. */ -#include "log.h" +#include +#include #include "samgr_lite.h" void __attribute__((weak)) OHOS_SystemInit(void) @@ -24,5 +25,7 @@ void __attribute__((weak)) OHOS_SystemInit(void) int main() { OHOS_SystemInit(); - pause(); + // pause only returns when a signal was caught and the signal-catching function returned. + // pause only returns -1, no need to process the return value. + (void)pause(); } \ No newline at end of file diff --git a/services/src/sensor_service_impl.c b/services/src/sensor_service_impl.c old mode 100755 new mode 100644 index c272e49676732abc1a74449ed97e88341b8dc64e..c928cb09a5984ec03358aa7eae4322a7f6620f6f --- a/services/src/sensor_service_impl.c +++ b/services/src/sensor_service_impl.c @@ -21,10 +21,11 @@ #include "liteipc_adapter.h" #include "sensor_service.h" +#include "sensor_type.h" -static struct SensorInfos *g_sensorLists; +static struct SensorInformation *g_sensorLists; static int32_t g_sensorListsLength; -static struct SensorInterface *g_sensorDevice; +const struct SensorInterface *g_sensorDevice; static SvcIdentity g_svcIdentity = { .handle = 0, .token = 0, @@ -54,7 +55,7 @@ const char *SENSOR_GetName(Service *service) return SENSOR_SERVICE; } -static int SensorDataCallback(const SensorEvent *event) +static int SensorDataCallback(const struct SensorEvent *event) { HILOG_DEBUG(HILOG_MODULE_APP, "[SERVICE:%s]: %s begin", SENSOR_SERVICE, __func__); if ((event == NULL) || (event->dataLen == 0)) { @@ -66,8 +67,8 @@ static int SensorDataCallback(const SensorEvent *event) uint8_t data[IPC_IO_DATA_MAX]; IpcIoInit(&io, data, IPC_IO_DATA_MAX, IPC_MAX_OBJECTS); BuffPtr eventBuff = { - .buffSz = (uint32_t)(sizeof(SensorEvent)), - .buff = event + .buffSz = (uint32_t)(sizeof(struct SensorEvent)), + .buff = (void *)(event) }; BuffPtr sensorDataBuff = { .buffSz = (uint32_t)(event->dataLen), @@ -84,7 +85,7 @@ static int SensorDataCallback(const SensorEvent *event) return SENSOR_OK; } -void SetSvcIdentity(const IpcIo *req, const IpcIo *reply) +void SetSvcIdentity(IpcIo *req, const IpcIo *reply) { SvcIdentity *sid = IpcIoPopSvc(req); if (sid == NULL) { @@ -233,7 +234,7 @@ int32_t SubscribeSensorImpl(int32_t sensorId, const SensorUser *user) SENSOR_SERVICE, __func__); return SENSOR_ERROR_INVALID_PARAM; } - int32_t ret = g_sensorDevice->Register(0, SensorDataCallback); + int32_t ret = g_sensorDevice->Register(0, (RecordDataCallback)SensorDataCallback); if (ret != 0) { HILOG_ERROR(HILOG_MODULE_APP, "[SERVICE:%s]: %s register sensor user failed, ret: %d", SENSOR_SERVICE, __func__, ret);