diff --git a/interfaces/plugin/src/sensor_js.cpp b/interfaces/plugin/src/sensor_js.cpp index 56f2464932b9ae6c470d74c1c762e0ff0411434e..d98c24d32bfef706261a4b89b4445dd81a14916b 100644 --- a/interfaces/plugin/src/sensor_js.cpp +++ b/interfaces/plugin/src/sensor_js.cpp @@ -448,7 +448,7 @@ static napi_value TransformCoordinateSystem(napi_env env, napi_callback_info inf for (size_t i = 0; i < length; ++i) { asyncCallbackInfo->data.reserveData.reserve[i] = outRotationVector[i]; } - asyncCallbackInfo->data.reserveData.length = length; + asyncCallbackInfo->data.reserveData.length = static_cast(length); } if (argc == 2) { napi_value promise = nullptr; diff --git a/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h b/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h index 9c9d041e278c1d9981a60108e02f2fa35c06e069..6b122bfa1539d6320cef4b360d1e900d20889408 100644 --- a/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h +++ b/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h @@ -33,17 +33,17 @@ public: int32_t GetSensorList(std::vector& sensorList); - int32_t EnableSensor(uint32_t sensorId); + int32_t EnableSensor(int32_t sensorId); - int32_t DisableSensor(uint32_t sensorId); + int32_t DisableSensor(int32_t sensorId); int32_t SetBatch(int32_t sensorId, int64_t samplingInterval, int64_t reportInterval); int32_t SetMode(int32_t sensorId, int32_t mode); - int32_t SetOption(int32_t sensorId, uint32_t option); + int32_t SetOption(int32_t sensorId, int32_t option); - int32_t RunCommand(uint32_t sensorId, int32_t cmd, int32_t params); + int32_t RunCommand(int32_t sensorId, int32_t cmd, int32_t params); int32_t Register(RecordDataCallback cb); diff --git a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp index 3916dc7642556edc733888ebff3ae30ff1fb3b25..288021fdd0a2796de6b416b201e68762778396e5 100644 --- a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -63,7 +63,7 @@ void HdiServiceImpl::DataReportThread() return; } -int32_t HdiServiceImpl::EnableSensor(uint32_t sensorId) +int32_t HdiServiceImpl::EnableSensor(int32_t sensorId) { CALL_LOG_ENTER; CHKPR(g_callback, ERROR); @@ -87,7 +87,7 @@ int32_t HdiServiceImpl::EnableSensor(uint32_t sensorId) return ERR_OK; }; -int32_t HdiServiceImpl::DisableSensor(uint32_t sensorId) +int32_t HdiServiceImpl::DisableSensor(int32_t sensorId) { CALL_LOG_ENTER; if (std::find(supportSensors.begin(), supportSensors.end(), sensorId) == supportSensors.end()) { @@ -128,12 +128,12 @@ int32_t HdiServiceImpl::SetMode(int32_t sensorId, int32_t mode) return ERR_OK; } -int32_t HdiServiceImpl::RunCommand(uint32_t sensorId, int32_t cmd, int32_t params) +int32_t HdiServiceImpl::RunCommand(int32_t sensorId, int32_t cmd, int32_t params) { return ERR_OK; } -int32_t HdiServiceImpl::SetOption(int32_t sensorId, uint32_t option) +int32_t HdiServiceImpl::SetOption(int32_t sensorId, int32_t option) { return ERR_OK; }