From dbb123e3934082f055d59c303fb60d72c9d0aa0f Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Fri, 8 Aug 2025 15:52:27 +0800 Subject: [PATCH 1/2] Alert modification Signed-off-by: bailu1992 --- .vscode/c_cpp_properties.json | 18 +++++++++++ .vscode/launch.json | 24 ++++++++++++++ .vscode/settings.json | 59 +++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 00000000..77126915 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "D:/tools/mingw64/bin/gcc.exe", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..89ef9270 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": "d:/bailu/code/sensor0808/sensors_sensor/frameworks/js/napi/src", + "program": "d:/bailu/code/sensor0808/sensors_sensor/frameworks/js/napi/src/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..bb879da5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false +} \ No newline at end of file -- Gitee From 856eb2b9f58a9bded4de4b5a1f514b650aed5c8c Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Fri, 8 Aug 2025 15:58:21 +0800 Subject: [PATCH 2/2] Alert modification Signed-off-by: bailu1992 --- .vscode/c_cpp_properties.json | 18 ------ .vscode/launch.json | 24 -------- .vscode/settings.json | 59 ------------------- .../js/napi/include/sensor_napi_utils.h | 2 +- frameworks/js/napi/src/sensor_js.cpp | 4 +- frameworks/js/napi/src/sensor_napi_utils.cpp | 2 +- frameworks/native/src/sensor_agent_proxy.cpp | 30 +++++----- .../native/src/sensor_service_client.cpp | 2 +- .../adapter/src/compatible_connection.cpp | 8 +-- .../adapter/src/hdi_connection.cpp | 28 +++++---- .../hardware/src/hdi_service_impl.cpp | 2 +- .../interface/src/sensor_hdi_connection.cpp | 16 ++--- services/src/client_info.cpp | 21 +++---- services/src/sensor_dump.cpp | 8 +-- services/src/sensor_manager.cpp | 4 +- services/src/sensor_service.cpp | 8 +-- 16 files changed, 69 insertions(+), 167 deletions(-) delete mode 100644 .vscode/c_cpp_properties.json delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 77126915..00000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "configurations": [ - { - "name": "windows-gcc-x64", - "includePath": [ - "${workspaceFolder}/**" - ], - "compilerPath": "D:/tools/mingw64/bin/gcc.exe", - "cStandard": "${default}", - "cppStandard": "${default}", - "intelliSenseMode": "windows-gcc-x64", - "compilerArgs": [ - "" - ] - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 89ef9270..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "C/C++ Runner: Debug Session", - "type": "cppdbg", - "request": "launch", - "args": [], - "stopAtEntry": false, - "externalConsole": true, - "cwd": "d:/bailu/code/sensor0808/sensors_sensor/frameworks/js/napi/src", - "program": "d:/bailu/code/sensor0808/sensors_sensor/frameworks/js/napi/src/build/Debug/outDebug", - "MIMode": "gdb", - "miDebuggerPath": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index bb879da5..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "C_Cpp_Runner.cCompilerPath": "gcc", - "C_Cpp_Runner.cppCompilerPath": "g++", - "C_Cpp_Runner.debuggerPath": "gdb", - "C_Cpp_Runner.cStandard": "", - "C_Cpp_Runner.cppStandard": "", - "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", - "C_Cpp_Runner.useMsvc": false, - "C_Cpp_Runner.warnings": [ - "-Wall", - "-Wextra", - "-Wpedantic", - "-Wshadow", - "-Wformat=2", - "-Wcast-align", - "-Wconversion", - "-Wsign-conversion", - "-Wnull-dereference" - ], - "C_Cpp_Runner.msvcWarnings": [ - "/W4", - "/permissive-", - "/w14242", - "/w14287", - "/w14296", - "/w14311", - "/w14826", - "/w44062", - "/w44242", - "/w14905", - "/w14906", - "/w14263", - "/w44265", - "/w14928" - ], - "C_Cpp_Runner.enableWarnings": true, - "C_Cpp_Runner.warningsAsError": false, - "C_Cpp_Runner.compilerArgs": [], - "C_Cpp_Runner.linkerArgs": [], - "C_Cpp_Runner.includePaths": [], - "C_Cpp_Runner.includeSearch": [ - "*", - "**/*" - ], - "C_Cpp_Runner.excludeSearch": [ - "**/build", - "**/build/**", - "**/.*", - "**/.*/**", - "**/.vscode", - "**/.vscode/**" - ], - "C_Cpp_Runner.useAddressSanitizer": false, - "C_Cpp_Runner.useUndefinedSanitizer": false, - "C_Cpp_Runner.useLeakSanitizer": false, - "C_Cpp_Runner.showCompilationTime": false, - "C_Cpp_Runner.useLinkTimeOptimization": false, - "C_Cpp_Runner.msvcSecureNoWarnings": false -} \ No newline at end of file diff --git a/frameworks/js/napi/include/sensor_napi_utils.h b/frameworks/js/napi/include/sensor_napi_utils.h index bd5a3328..88bab2d7 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 df7b31f2..4e93c67a 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 34aec191..cb649b89 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 82be163f..d86e4e87 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 349d9786..42b72118 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 5de33fc9..fd40307b 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 1e0fadab..73ca2ba1 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 909a2982..9c3921db 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 801c98c6..f0ba3408 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 7fd9ba26..70a33c01 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 e8594834..41240b5e 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 3a4b5966..43f82247 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 bf4664a8..3cf324c4 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 -- Gitee