diff --git a/frameworks/js/napi/include/sensor_napi_utils.h b/frameworks/js/napi/include/sensor_napi_utils.h index bd5a3328baecd78a7b8cc5de2ea334146571ce48..88bab2d7003bd0d59ed14c5011985a4582f28eab 100644 --- a/frameworks/js/napi/include/sensor_napi_utils.h +++ b/frameworks/js/napi/include/sensor_napi_utils.h @@ -49,7 +49,7 @@ bool ConvertToNumber(const napi_env &env, sptr asyncCallbackI bool ConvertToArray(const napi_env &env, sptr asyncCallbackInfo, napi_value result[2]); bool ConvertToRotationMatrix(const napi_env &env, sptr asyncCallbackInfo, napi_value result[2]); bool ConvertToSensorData(const napi_env &env, sptr asyncCallbackInfo, napi_value result[2], - const int32_t resultSize, std::shared_ptr data); + int32_t resultSize, std::shared_ptr data); bool CreateNapiArray(const napi_env &env, float *data, int32_t dataLength, napi_value &result); bool ConvertToSensorInfos(const napi_env &env, sptr asyncCallbackInfo, napi_value result[2]); bool ConvertToSingleSensor(const napi_env &env, sptr asyncCallbackInfo, napi_value result[2]); diff --git a/frameworks/js/napi/src/sensor_js.cpp b/frameworks/js/napi/src/sensor_js.cpp index df7b31f2a465296470a71c1ed870b4287bf140dc..4e93c67aa252cec800bc1b400fe33aa29976beb0 100644 --- a/frameworks/js/napi/src/sensor_js.cpp +++ b/frameworks/js/napi/src/sensor_js.cpp @@ -292,7 +292,7 @@ static bool IsOnceSubscribed(napi_env env, SensorDescription sensorDesc, napi_va CALL_LOG_ENTER; auto iter = g_onceCallbackInfos.find(sensorDesc); if (iter == g_onceCallbackInfos.end()) { - SEN_HILOGW("Already subscribed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGW("Already subscribed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return false; } @@ -414,7 +414,7 @@ static bool IsSubscribed(napi_env env, SensorDescription sensorDesc, napi_value CALL_LOG_ENTER; auto iter = g_onCallbackInfos.find(sensorDesc); if (iter == g_onCallbackInfos.end()) { - SEN_HILOGW("No client subscribe, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGW("No client subscribe, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return false; } diff --git a/frameworks/js/napi/src/sensor_napi_utils.cpp b/frameworks/js/napi/src/sensor_napi_utils.cpp index 34aec191264fa731fd9dc1dc05c28d115a30a495..cb649b8966f95f6f7593fcccb5a832244a076c9d 100644 --- a/frameworks/js/napi/src/sensor_napi_utils.cpp +++ b/frameworks/js/napi/src/sensor_napi_utils.cpp @@ -364,7 +364,7 @@ bool ConvertToSensorState(const napi_env &env, sptr asyncCall } bool ConvertToSensorData(const napi_env &env, sptr asyncCallbackInfo, napi_value result[2], - const int32_t resultSize, std::shared_ptr data) + int32_t resultSize, std::shared_ptr data) { CHKPF(asyncCallbackInfo); CHKPF(data); diff --git a/frameworks/native/src/sensor_agent_proxy.cpp b/frameworks/native/src/sensor_agent_proxy.cpp index 82be163f0d264c1ae290fb160430ca27b8d66450..d86e4e87b113b0dd69e12844212f3f30a0136350 100644 --- a/frameworks/native/src/sensor_agent_proxy.cpp +++ b/frameworks/native/src/sensor_agent_proxy.cpp @@ -164,7 +164,7 @@ int32_t SensorAgentProxy::DestroySensorDataChannel() int32_t SensorAgentProxy::ActivateSensor(const SensorDescription &sensorDesc, const SensorUser *user) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); CHKPR(user, OHOS::Sensors::ERROR); CHKPR(user->callback, OHOS::Sensors::ERROR); @@ -173,7 +173,7 @@ int32_t SensorAgentProxy::ActivateSensor(const SensorDescription &sensorDesc, co return ERROR; } if (!SEN_CLIENT.IsValid(sensorDesc)) { - SEN_HILOGE("sensorDesc is invalid, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("sensorDesc is invalid, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return PARAMETER_ERROR; } @@ -200,21 +200,21 @@ int32_t SensorAgentProxy::ActivateSensor(const SensorDescription &sensorDesc, co } return ret; } - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ret; } int32_t SensorAgentProxy::DeactivateSensor(const SensorDescription &sensorDesc, const SensorUser *user) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, location:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, peripheralId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId, sensorDesc.location); CHKPR(user, OHOS::Sensors::ERROR); CHKPR(user->callback, OHOS::Sensors::ERROR); std::lock_guard subscribeLock(subscribeMutex_); if (!(SEN_CLIENT.IsValid(sensorDesc) || ((!SEN_CLIENT.IsValid(sensorDesc)) && subscribeMap_.find(sensorDesc) != subscribeMap_.end()))) { - SEN_HILOGE("sensorDesc is invalid, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("sensorDesc is invalid, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return PARAMETER_ERROR; } @@ -248,7 +248,7 @@ int32_t SensorAgentProxy::DeactivateSensor(const SensorDescription &sensorDesc, return ret; } } - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return OHOS::Sensors::SUCCESS; } @@ -258,7 +258,7 @@ int32_t SensorAgentProxy::SetBatch(const SensorDescription &sensorDesc, const Se { CHKPR(user, OHOS::Sensors::ERROR); if (!SEN_CLIENT.IsValid(sensorDesc)) { - SEN_HILOGE("sensorDesc is invalid, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("sensorDesc is invalid, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return PARAMETER_ERROR; } @@ -283,12 +283,12 @@ int32_t SensorAgentProxy::SetBatch(const SensorDescription &sensorDesc, const Se int32_t SensorAgentProxy::SubscribeSensor(const SensorDescription &sensorDesc, const SensorUser *user) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); CHKPR(user, OHOS::Sensors::ERROR); CHKPR(user->callback, OHOS::Sensors::ERROR); if (!SEN_CLIENT.IsValid(sensorDesc)) { - SEN_HILOGE("sensorDesc is invalid, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("sensorDesc is invalid, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return PARAMETER_ERROR; } @@ -306,7 +306,7 @@ int32_t SensorAgentProxy::SubscribeSensor(const SensorDescription &sensorDesc, c if (PrintSensorData::GetInstance().IsContinuousType(sensorDesc.sensorType)) { PrintSensorData::GetInstance().SavePrintUserInfo(user->callback); } - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return OHOS::Sensors::SUCCESS; } @@ -319,7 +319,7 @@ bool SensorAgentProxy::IsSubscribeMapEmpty() const int32_t SensorAgentProxy::UnsubscribeSensor(const SensorDescription &sensorDesc, const SensorUser *user) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); CHKPR(user, OHOS::Sensors::ERROR); CHKPR(user->callback, OHOS::Sensors::ERROR); @@ -327,7 +327,7 @@ int32_t SensorAgentProxy::UnsubscribeSensor(const SensorDescription &sensorDesc, std::lock_guard subscribeLock(subscribeMutex_); if (!(SEN_CLIENT.IsValid(sensorDesc) || ((!SEN_CLIENT.IsValid(sensorDesc)) && unsubscribeMap_.find(sensorDesc) != unsubscribeMap_.end()))) { - SEN_HILOGE("sensorDesc is invalid, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("sensorDesc is invalid, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return PARAMETER_ERROR; } @@ -356,7 +356,7 @@ int32_t SensorAgentProxy::UnsubscribeSensor(const SensorDescription &sensorDesc, if (PrintSensorData::GetInstance().IsContinuousType(sensorDesc.sensorType)) { PrintSensorData::GetInstance().RemovePrintUserInfo(user->callback); } - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return OHOS::Sensors::SUCCESS; } @@ -366,7 +366,7 @@ int32_t SensorAgentProxy::SetMode(const SensorDescription &sensorDesc, const Sen CHKPR(user, OHOS::Sensors::ERROR); CHKPR(user->callback, OHOS::Sensors::ERROR); if (!SEN_CLIENT.IsValid(sensorDesc)) { - SEN_HILOGE("sensorDesc is invalid,deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("sensorDesc is invalid,deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ERROR; } @@ -544,7 +544,7 @@ bool SensorAgentProxy::FindSensorInfo(int32_t deviceId, int32_t sensorIndex, int if (sensorInfoCheck_.sensorInfos[i].deviceId == deviceId && sensorInfoCheck_.sensorInfos[i].sensorIndex == sensorIndex && sensorInfoCheck_.sensorInfos[i].sensorTypeId == sensorTypeId) { - SEN_HILOGI("FindSensorInfo deviceId:%{public}d, sensorTypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("FindSensorInfo deviceIndex:%{public}d, sensorTypeId:%{public}d, sensorId:%{public}d", deviceId, sensorTypeId, sensorIndex); return true; } diff --git a/frameworks/native/src/sensor_service_client.cpp b/frameworks/native/src/sensor_service_client.cpp index 349d978676b330726bf1f95488698e0708d693ff..42b7211845c1e3c22e4d022732f8845c928da761 100644 --- a/frameworks/native/src/sensor_service_client.cpp +++ b/frameworks/native/src/sensor_service_client.cpp @@ -245,7 +245,7 @@ int32_t SensorServiceClient::GetSensorListByDevice(int32_t deviceId, std::vector std::lock_guard clientLock(clientMutex_); for (const auto& sensor : sensorList_) { if (sensor.GetDeviceId() == deviceId) { - SEN_HILOGD("sensor.GetDeviceId():%{public}d, deviceId:%{public}d", sensor.GetDeviceId(), deviceId); + SEN_HILOGD("sensor.GetDeviceId():%{public}d, deviceIndex:%{public}d", sensor.GetDeviceId(), deviceId); singleDevSensors.push_back(sensor); } } diff --git a/services/hdi_connection/adapter/src/compatible_connection.cpp b/services/hdi_connection/adapter/src/compatible_connection.cpp index 5de33fc9302c78a0584a6d98a8d3c40de83d582f..fd40307b5df939552c076b0a2781e9512a1793d5 100644 --- a/services/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/hdi_connection/adapter/src/compatible_connection.cpp @@ -78,7 +78,7 @@ int32_t CompatibleConnection::EnableSensor(const SensorDescription &sensorDesc) { int32_t ret = hdiServiceImpl_.EnableSensor(sensorDesc); if (ret != 0) { - SEN_HILOGE("Enable sensor failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Enable sensor failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ret; } @@ -89,7 +89,7 @@ int32_t CompatibleConnection::DisableSensor(const SensorDescription &sensorDesc) { int32_t ret = hdiServiceImpl_.DisableSensor(sensorDesc); if (ret != 0) { - SEN_HILOGE("Disable sensor failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Disable sensor failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ret; } @@ -101,7 +101,7 @@ int32_t CompatibleConnection::SetBatch(const SensorDescription &sensorDesc, int6 { int32_t ret = hdiServiceImpl_.SetBatch(sensorDesc, samplingInterval, reportInterval); if (ret != 0) { - SEN_HILOGE("Set batch failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Set batch failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ret; } @@ -112,7 +112,7 @@ int32_t CompatibleConnection::SetMode(const SensorDescription &sensorDesc, int32 { int32_t ret = hdiServiceImpl_.SetMode(sensorDesc, mode); if (ret != 0) { - SEN_HILOGI("Set mode failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Set mode failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ret; } diff --git a/services/hdi_connection/adapter/src/hdi_connection.cpp b/services/hdi_connection/adapter/src/hdi_connection.cpp index 1e0fadab9402689cd81717a28273658e9f345493..73ca2ba1d83b59ca9cfca5276cf8594d78c4c93e 100644 --- a/services/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/hdi_connection/adapter/src/hdi_connection.cpp @@ -129,7 +129,7 @@ int32_t HdiConnection::GetSensorList(std::vector &sensorList) int32_t HdiConnection::EnableSensor(const SensorDescription &sensorDesc) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); std::lock_guard sensorInterface(g_sensorInterfaceMutex); CHKPR(g_sensorInterface, ERR_NO_INIT); @@ -145,14 +145,14 @@ int32_t HdiConnection::EnableSensor(const SensorDescription &sensorDesc) return ret; } SetSensorBasicInfoState(sensorDesc, true); - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ERR_OK; } int32_t HdiConnection::DisableSensor(const SensorDescription &sensorDesc) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); std::lock_guard sensorInterface(g_sensorInterfaceMutex); CHKPR(g_sensorInterface, ERR_NO_INIT); @@ -168,7 +168,7 @@ int32_t HdiConnection::DisableSensor(const SensorDescription &sensorDesc) return ret; } DeleteSensorBasicInfoState(sensorDesc); - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ERR_OK; } @@ -325,7 +325,7 @@ void HdiConnection::UpdateSensorBasicInfo(const SensorDescription &sensorDesc, i void HdiConnection::SetSensorBasicInfoState(const SensorDescription &sensorDesc, bool state) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); std::lock_guard sensorInfoLock(g_sensorBasicInfoMutex); auto it = g_sensorBasicInfoMap.find(sensorDesc); @@ -334,20 +334,20 @@ void HdiConnection::SetSensorBasicInfoState(const SensorDescription &sensorDesc, return; } g_sensorBasicInfoMap[sensorDesc].SetSensorState(state); - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); } void HdiConnection::DeleteSensorBasicInfoState(const SensorDescription &sensorDesc) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); std::lock_guard sensorInfoLock(g_sensorBasicInfoMutex); auto it = g_sensorBasicInfoMap.find(sensorDesc); if (it != g_sensorBasicInfoMap.end()) { g_sensorBasicInfoMap.erase(sensorDesc); } - SEN_HILOGI("Done,deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done,deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); } @@ -393,7 +393,7 @@ void HdiConnection::ReEnableSensor() for (const auto &sensorInfo: g_sensorBasicInfoMap) { SensorBasicInfo info = sensorInfo.second; if (!info.GetSensorState()) { - SEN_HILOGE("deviceId:%{public}d, sensortype:%{public}d, sensorId:%{public}d don't need enable sensor", + SEN_HILOGE("deviceIndex:%{public}d, sensortype:%{public}d, sensorId:%{public}d don't need enable sensor", sensorInfo.first.deviceId, sensorInfo.first.sensorType, sensorInfo.first.sensorId); continue; } @@ -402,16 +402,18 @@ void HdiConnection::ReEnableSensor() sensorInfo.first.sensorId, sensorInfo.first.location}, info.GetSamplingPeriodNs(), info.GetMaxReportDelayNs()); if (ret != ERR_OK) { - SEN_HILOGE("deviceId:%{public}d, sensortype:%{public}d, sensorId:%{public}d set batch fail, err:%{public}d", - sensorInfo.first.deviceId, sensorInfo.first.sensorType, sensorInfo.first.sensorId, ret); + SEN_HILOGE("deviceIndex:%{public}d, sensortype:%{public}d, sensorId:%{public}d set batch fail," + "err:%{public}d", sensorInfo.first.deviceId, sensorInfo.first.sensorType, sensorInfo.first.sensorId, + ret); continue; } SensorXcollie enableXcollie("HdiConnection:Reconnect:ReEnable", XCOLLIE_TIMEOUT_5S); ret = g_sensorInterface->Enable({sensorInfo.first.deviceId, sensorInfo.first.sensorType, sensorInfo.first.sensorId, sensorInfo.first.location}); if (ret != ERR_OK) { - SEN_HILOGE("Enable fail, deviceId:%{public}d, sensortype:%{public}d, sensorId:%{public}d, err:%{public}d", - sensorInfo.first.deviceId, sensorInfo.first.sensorType, sensorInfo.first.sensorId, ret); + SEN_HILOGE("Enable fail, deviceIndex:%{public}d, sensortype:%{public}d, sensorId:%{public}d," + "err:%{public}d", sensorInfo.first.deviceId, sensorInfo.first.sensorType, sensorInfo.first.sensorId, + ret); } } } diff --git a/services/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/hdi_connection/hardware/src/hdi_service_impl.cpp index 909a29820dce752920dd8ae5c30db5646caa57c6..9c3921db4e1b26c6d92b1e49305290a8ba8663e2 100644 --- a/services/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -286,7 +286,7 @@ int32_t HdiServiceImpl::DisableSensor(const SensorDescription &sensorDesc) { CALL_LOG_ENTER; if (std::find(g_supportSensors.begin(), g_supportSensors.end(), sensorDesc.sensorType) == g_supportSensors.end()) { - SEN_HILOGE("Not support disable deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Not support disable deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ERR_NO_INIT; } diff --git a/services/hdi_connection/interface/src/sensor_hdi_connection.cpp b/services/hdi_connection/interface/src/sensor_hdi_connection.cpp index 801c98c635105e2c1549535f7670be833c9fd5bb..f0ba3408bf246189a55dc04378fcddd63c13cbe6 100644 --- a/services/hdi_connection/interface/src/sensor_hdi_connection.cpp +++ b/services/hdi_connection/interface/src/sensor_hdi_connection.cpp @@ -269,7 +269,7 @@ int32_t SensorHdiConnection::EnableSensor(const SensorDescription &sensorDesc) #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { SEN_HILOGE( - "Enable failed in compatible, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + "Enable failed in compatible, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ENABLE_SENSOR_ERR; } @@ -282,7 +282,7 @@ int32_t SensorHdiConnection::EnableSensor(const SensorDescription &sensorDesc) FinishTrace(HITRACE_TAG_SENSORS); #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { - SEN_HILOGI("Enable failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Enable failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ENABLE_SENSOR_ERR; } @@ -304,7 +304,7 @@ int32_t SensorHdiConnection::DisableSensor(const SensorDescription &sensorDesc) #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { SEN_HILOGE( - "Disable failed in compatible, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + "Disable failed in compatible, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return DISABLE_SENSOR_ERR; } @@ -317,7 +317,7 @@ int32_t SensorHdiConnection::DisableSensor(const SensorDescription &sensorDesc) FinishTrace(HITRACE_TAG_SENSORS); #endif // HIVIEWDFX_HITRACE_ENABLE if ((ret != ERR_OK) && (ret != HDI_DISABLE_SENSOR_TIMEOUT)) { - SEN_HILOGI("Disable sensor failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Disable sensor failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return DISABLE_SENSOR_ERR; } @@ -343,7 +343,7 @@ int32_t SensorHdiConnection::SetBatch(const SensorDescription &sensorDesc, int64 #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { SEN_HILOGI( - "Set batch failed in compatible, deviceId:%{public}d, sensortype:%{public}d, sensorId:%{public}d", + "Set batch failed in compatible, deviceIndex:%{public}d, sensortype:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return SET_SENSOR_CONFIG_ERR; } @@ -356,7 +356,7 @@ int32_t SensorHdiConnection::SetBatch(const SensorDescription &sensorDesc, int64 FinishTrace(HITRACE_TAG_SENSORS); #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { - SEN_HILOGI("Set batch failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Set batch failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return SET_SENSOR_CONFIG_ERR; } @@ -377,7 +377,7 @@ int32_t SensorHdiConnection::SetMode(const SensorDescription &sensorDesc, int32_ FinishTrace(HITRACE_TAG_SENSORS); #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { - SEN_HILOGI("Set mode failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Set mode failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return SET_SENSOR_MODE_ERR; } @@ -390,7 +390,7 @@ int32_t SensorHdiConnection::SetMode(const SensorDescription &sensorDesc, int32_ FinishTrace(HITRACE_TAG_SENSORS); #endif // HIVIEWDFX_HITRACE_ENABLE if (ret != ERR_OK) { - SEN_HILOGI("Set mode failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Set mode failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return SET_SENSOR_MODE_ERR; } diff --git a/services/src/client_info.cpp b/services/src/client_info.cpp index 7fd9ba26bea724944c9c2e0d036775e4ce8c13c3..70a33c0159d14122990d1eea5f1395ae2d192e78 100644 --- a/services/src/client_info.cpp +++ b/services/src/client_info.cpp @@ -46,7 +46,7 @@ std::unordered_map> ClientInfo::userGrantPermMap_ bool ClientInfo::GetSensorState(const SensorDescription &sensorDesc) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); if (sensorDesc.sensorType == INVALID_SENSOR_ID) { SEN_HILOGE("sensorType is invalid"); @@ -63,7 +63,7 @@ bool ClientInfo::GetSensorState(const SensorDescription &sensorDesc) return true; } } - SEN_HILOGE("Can't find sensorInfo, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Can't find sensorInfo, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return false; } @@ -83,8 +83,9 @@ SensorBasicInfo ClientInfo::GetBestSensorInfo(const SensorDescription &sensorDes std::lock_guard clientLock(clientMutex_); auto it = clientMap_.find(sensorDesc); if (it == clientMap_.end()) { - SEN_HILOGE("Can't find deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, location:%{public}d", - sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId, sensorDesc.location); + SEN_HILOGE("Can't find deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d," + "peripheralId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId, + sensorDesc.location); return sensorInfo; } for (const auto &pidIt : it->second) { @@ -108,7 +109,7 @@ bool ClientInfo::OnlyCurPidSensorEnabled(const SensorDescription &sensorDesc, in std::lock_guard clientLock(clientMutex_); auto it = clientMap_.find(sensorDesc); if (it == clientMap_.end()) { - SEN_HILOGE("Can't find deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Can't find deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return false; } @@ -218,7 +219,7 @@ std::vector> ClientInfo::GetSensorChannel(const Sen auto clientIt = clientMap_.find(sensorDesc); if (clientIt == clientMap_.end()) { SEN_HILOGD("There is no channel belong to sensor," - "deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + "deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return {}; } @@ -304,7 +305,7 @@ bool ClientInfo::UpdateSensorChannel(int32_t pid, const sptr clientLock(clientMutex_); auto it = clientMap_.find(sensorDesc); if (it == clientMap_.end()) { - SEN_HILOGE("Can't find deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Can't find deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return sensorInfo; } @@ -462,14 +463,14 @@ int32_t ClientInfo::GetStoreEvent(const SensorDescription &sensorDesc, SensorDat if (storedEvent != storedEvent_.end()) { errno_t ret = memcpy_s(&data, sizeof(data), &storedEvent->second, sizeof(storedEvent->second)); if (ret != EOK) { - SEN_HILOGE("memcpy_s failed, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("memcpy_s failed, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ret; } return ERR_OK; } - SEN_HILOGE("Can't get store event, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGE("Can't get store event, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return NO_STORE_EVENT; } diff --git a/services/src/sensor_dump.cpp b/services/src/sensor_dump.cpp index e85948349d577c5e3e8c7b2a881ad5630d5dae79..41240b5e84f70405a2a35cd3d311cad9f371635b 100644 --- a/services/src/sensor_dump.cpp +++ b/services/src/sensor_dump.cpp @@ -205,7 +205,7 @@ bool SensorDump::DumpSensorList(int32_t fd, const std::vector &sensors) continue; } dprintf(fd, - "deviceId:%d | sensorType:%s |sensorId:%8u |sensorIndex:%d | sensorName:%s | vendorName:%s" + "deviceIndex:%d | sensorType:%s |sensorId:%8u |sensorIndex:%d | sensorName:%s | vendorName:%s" "| maxRange:%f| fifoMaxEventCount:%d | minSamplePeriodNs:%" PRId64 "" "| maxSamplePeriodNs:%" PRId64 "\n", deviceId, sensorMap_[sensorTypeId].c_str(), sensorTypeId, sensorId, sensor.GetSensorName().c_str(), @@ -229,7 +229,7 @@ bool SensorDump::DumpSensorChannel(int32_t fd, ClientInfo &clientInfo) continue; } dprintf(fd, - "uid:%d | packageName:%s | deviceId:%d | sensorType:%s |sensorId:%8u |sensorIndex:%d " + "uid:%d | packageName:%s | deviceIndex:%d | sensorType:%s |sensorId:%8u |sensorIndex:%d " "| samplingPeriodNs:%" PRId64 "| fifoCount:%u\n", channel.GetUid(), channel.GetPackageName().c_str(), deviceId, sensorMap_[sensorType].c_str(), sensorType, sensorId, channel.GetSamplingPeriodNs(), channel.GetFifoCount()); @@ -250,7 +250,7 @@ bool SensorDump::DumpOpeningSensor(int32_t fd, const std::vector &sensor } if (clientInfo.GetSensorState({sensor.GetDeviceId(), sensorTypeId, sensor.GetSensorId(), sensor.GetLocation()})) { - dprintf(fd, "deviceId:%d | sensorType:%s |sensorId:%8u |sensorIndex:%d | channelSize: %lu\n", + dprintf(fd, "deviceIndex:%d | sensorType:%s |sensorId:%8u |sensorIndex:%d | channelSize: %lu\n", deviceId, sensorMap_[sensorTypeId].c_str(), sensorTypeId, sensorId, clientInfo.GetSensorChannel({ sensor.GetDeviceId(), sensorTypeId, sensor.GetSensorId(), sensor.GetLocation()}).size()); } @@ -268,7 +268,7 @@ bool SensorDump::DumpSensorData(int32_t fd, ClientInfo &clientInfo) if (sensorMap_.find(sensorData.first.sensorType) == sensorMap_.end()) { continue; } - dprintf(fd, "deviceId:%d | sensorType:%s |sensorId:%8u :\n", sensorData.first.deviceId, + dprintf(fd, "deviceIndex:%d | sensorType:%s |sensorId:%8u :\n", sensorData.first.deviceId, sensorMap_[sensorData.first.sensorType].c_str(), sensorData.first.sensorId); for (uint32_t i = 0; i < MAX_DUMP_DATA_SIZE && (!sensorData.second.empty()); i++) { auto data = sensorData.second.front(); diff --git a/services/src/sensor_manager.cpp b/services/src/sensor_manager.cpp index 3a4b5966a5e18c49ce76b49e0ac2648490029ae4..43f82247e4731c4e9d9df3a022f2791dad55285b 100644 --- a/services/src/sensor_manager.cpp +++ b/services/src/sensor_manager.cpp @@ -71,7 +71,7 @@ bool SensorManager::SetBestSensorParams(const SensorDescription &sensorDesc, int bool SensorManager::ResetBestSensorParams(const SensorDescription &sensorDesc) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); if (sensorDesc.sensorType == INVALID_SENSOR_ID) { SEN_HILOGE("sensorType is invalid"); @@ -151,7 +151,7 @@ SensorBasicInfo SensorManager::GetSensorInfo(const SensorDescription &sensorDesc bool SensorManager::IsOtherClientUsingSensor(const SensorDescription &sensorDesc, int32_t clientPid) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, clientPid:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, clientPid:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId, clientPid); if (clientInfo_.OnlyCurPidSensorEnabled(sensorDesc, clientPid)) { SEN_HILOGD("Only current client using this sensor"); diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index bf4664a87f48c2e973cb181c01b77372a0d71fa0..3cf324c4516690adc84c3df31a62d1a61d0605f1 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -349,7 +349,7 @@ void SensorService::ReportOnChangeData(const SensorDescription &sensorDesc) ErrCode SensorService::SaveSubscriber(const SensorDescription &sensorDesc, int64_t samplingPeriodNs, int64_t maxReportDelayNs) { - SEN_HILOGI("In, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("In, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); if (!sensorManager_.SaveSubscriber(sensorDesc, GetCallingPid(), samplingPeriodNs, maxReportDelayNs)) { SEN_HILOGE("SaveSubscriber failed"); @@ -365,7 +365,7 @@ ErrCode SensorService::SaveSubscriber(const SensorDescription &sensorDesc, int64 return SET_SENSOR_CONFIG_ERR; } #endif // HDF_DRIVERS_INTERFACE_SENSOR - SEN_HILOGI("Done, deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", + SEN_HILOGI("Done, deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); return ERR_OK; } @@ -376,7 +376,7 @@ bool SensorService::CheckSensorId(const SensorDescription &sensorDesc) auto it = sensorMap_.find(sensorDesc); if (it == sensorMap_.end()) { SEN_HILOGE("Invalid sensorDesc," - "deviceId:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, location:%{public}d", + "deviceIndex:%{public}d, sensortypeId:%{public}d, sensorId:%{public}d, peripheralId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId, sensorDesc.location); return false; } @@ -519,7 +519,7 @@ ErrCode SensorService::DisableSensor(const SensorDescription &sensorDesc, int32_ SEN_HILOGE("DisableSensor is failed"); return DISABLE_SENSOR_ERR; } - SEN_HILOGW("DisableSensor is failed, deviceId:%{public}d, sensorType:%{public}d, sensorId:%{public}d", + SEN_HILOGW("DisableSensor is failed, deviceIndex:%{public}d, sensorType:%{public}d, sensorId:%{public}d", sensorDesc.deviceId, sensorDesc.sensorType, sensorDesc.sensorId); } #endif // HDF_DRIVERS_INTERFACE_SENSOR