From 8547e4450edcbaac281f8d24122d0707993f4160 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Mar 2022 14:57:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9C=89begin=E5=8A=A0=E4=B8=8A=E5=AF=B9?= =?UTF-8?q?=E5=BA=94end=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- .../adapter/src/compatible_connection.cpp | 1 + .../hdi_connection/adapter/src/hdi_connection.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp b/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp index a3d95b9d..13b0d0db 100644 --- a/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/compatible_connection.cpp @@ -33,6 +33,7 @@ std::mutex ISensorHdiConnection::dataMutex_; std::condition_variable ISensorHdiConnection::dataCondition_; int32_t CompatibleConnection::ConnectHdi() { + HiLog::Info(LABEL, "%{public}s connect hdi success", __func__); return ERR_OK; } diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index bc9c43cc..65b52282 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -64,6 +64,7 @@ int32_t HdiConnection::ConnectHdi() } HiLog::Error(LABEL, "%{public}s connect v1_0 hdi failed", __func__); return ERR_NO_INIT; + HiLog::Debug(LABEL, "%{public}s end", __func__); } int32_t HdiConnection::GetSensorList(std::vector& sensorList) @@ -99,6 +100,7 @@ int32_t HdiConnection::GetSensorList(std::vector& sensorList) sensorList.push_back(sensor); } return ERR_OK; + HiLog::Debug(LABEL, "%{public}s end", __func__); } int32_t HdiConnection::EnableSensor(int32_t sensorId) @@ -159,6 +161,7 @@ int32_t HdiConnection::SetMode(int32_t sensorId, int32_t mode) return ret; } return ERR_OK; + HiLog::Debug(LABEL, "%{public}s end", __func__); } int32_t HdiConnection::SetOption(int32_t sensorId, int32_t option) @@ -174,6 +177,7 @@ int32_t HdiConnection::SetOption(int32_t sensorId, int32_t option) return ret; } return ERR_OK; + HiLog::Debug(LABEL, "%{public}s end", __func__); } int32_t HdiConnection::RegisteDataReport(ZReportDataCb cb, sptr reportDataCallback) @@ -191,6 +195,7 @@ int32_t HdiConnection::RegisteDataReport(ZReportDataCb cb, sptr HdiConnection::getReportDataCallback() @@ -231,6 +238,7 @@ sptr HdiConnection::getReportDataCallback() HiLog::Error(LABEL, "%{public}s reportDataCallback_ cannot be null", __func__); } return reportDataCallback_; + HiLog::Debug(LABEL, "%{public}s end", __func__); } void HdiConnection::updateSensorBasicInfo(int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) @@ -286,6 +294,7 @@ void HdiConnection::UnregisterHdiDeathRecipient() return; } sensorInterface_->AsObject()->RemoveDeathRecipient(hdiDeathObserver_); + HiLog::Debug(LABEL, "%{public}s end", __func__); } void HdiConnection::ProcessDeathObserver(const wptr &object) @@ -299,6 +308,8 @@ void HdiConnection::ProcessDeathObserver(const wptr &object) hdiService->RemoveDeathRecipient(hdiDeathObserver_); eventCallback_ = nullptr; reconnect(); + HiLog::Debug(LABEL, "%{public}s end", __func__); + } void HdiConnection::reconnect() @@ -333,6 +344,7 @@ void HdiConnection::reconnect() ret = EnableSensor(sensorTypeId); if (ret < 0) { HiLog::Error(LABEL, "%{public}s enable sensor fail, sensorTypeId: %{public}d", __func__, sensorTypeId); + HiLog::Debug(LABEL, "%{public}s end", __func__); } } } -- Gitee From cd471c9e2fedec5040e6c8e1664581813649a379 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Mar 2022 14:59:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9C=89begin=E5=8A=A0=E4=B8=8A=E5=AF=B9?= =?UTF-8?q?=E5=BA=94end=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- services/sensor/hdi_connection/adapter/src/hdi_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 65b52282..644deb6a 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -344,8 +344,8 @@ void HdiConnection::reconnect() ret = EnableSensor(sensorTypeId); if (ret < 0) { HiLog::Error(LABEL, "%{public}s enable sensor fail, sensorTypeId: %{public}d", __func__, sensorTypeId); - HiLog::Debug(LABEL, "%{public}s end", __func__); } + HiLog::Debug(LABEL, "%{public}s end", __func__); } } } // namespace Sensors -- Gitee From 573c14623d8f19e72e038992248ab65580376908 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Mar 2022 15:01:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9C=89begin=E5=8A=A0=E4=B8=8A=E5=AF=B9?= =?UTF-8?q?=E5=BA=94end=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- services/sensor/hdi_connection/adapter/src/hdi_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 644deb6a..803b5d17 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -345,8 +345,8 @@ void HdiConnection::reconnect() if (ret < 0) { HiLog::Error(LABEL, "%{public}s enable sensor fail, sensorTypeId: %{public}d", __func__, sensorTypeId); } - HiLog::Debug(LABEL, "%{public}s end", __func__); } + HiLog::Debug(LABEL, "%{public}s end", __func__); } } // namespace Sensors } // namespace OHOS -- Gitee From e127ea25804f5d7cb14db5d9b67e6f8bf188d4ed Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Mar 2022 15:07:54 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9C=89begin=E5=8A=A0=E4=B8=8A=E5=AF=B9?= =?UTF-8?q?=E5=BA=94end=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- .../hdi_connection/adapter/src/hdi_connection.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 803b5d17..556719c3 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -64,7 +64,6 @@ int32_t HdiConnection::ConnectHdi() } HiLog::Error(LABEL, "%{public}s connect v1_0 hdi failed", __func__); return ERR_NO_INIT; - HiLog::Debug(LABEL, "%{public}s end", __func__); } int32_t HdiConnection::GetSensorList(std::vector& sensorList) @@ -99,8 +98,8 @@ int32_t HdiConnection::GetSensorList(std::vector& sensorList) sensor.SetPower(sensorInfos[i].power); sensorList.push_back(sensor); } - return ERR_OK; HiLog::Debug(LABEL, "%{public}s end", __func__); + return ERR_OK; } int32_t HdiConnection::EnableSensor(int32_t sensorId) @@ -160,8 +159,8 @@ int32_t HdiConnection::SetMode(int32_t sensorId, int32_t mode) HiLog::Error(LABEL, "%{public}s is failed", __func__); return ret; } - return ERR_OK; HiLog::Debug(LABEL, "%{public}s end", __func__); + return ERR_OK; } int32_t HdiConnection::SetOption(int32_t sensorId, int32_t option) @@ -176,8 +175,8 @@ int32_t HdiConnection::SetOption(int32_t sensorId, int32_t option) HiLog::Error(LABEL, "%{public}s is failed", __func__); return ret; } - return ERR_OK; HiLog::Debug(LABEL, "%{public}s end", __func__); + return ERR_OK; } int32_t HdiConnection::RegisteDataReport(ZReportDataCb cb, sptr reportDataCallback) @@ -194,8 +193,8 @@ int32_t HdiConnection::RegisteDataReport(ZReportDataCb cb, sptr HdiConnection::getReportDataCallback() @@ -237,8 +236,8 @@ sptr HdiConnection::getReportDataCallback() if (reportDataCallback_ == nullptr) { HiLog::Error(LABEL, "%{public}s reportDataCallback_ cannot be null", __func__); } - return reportDataCallback_; HiLog::Debug(LABEL, "%{public}s end", __func__); + return reportDataCallback_; } void HdiConnection::updateSensorBasicInfo(int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) -- Gitee From 873ac380e2ae04253b5c454f0443dd822265ff47 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Mar 2022 15:13:01 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9C=89begin=E5=8A=A0=E4=B8=8A=E5=AF=B9?= =?UTF-8?q?=E5=BA=94end=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- interfaces/plugin/src/sensor_js.cpp | 1 - services/sensor/hdi_connection/adapter/src/hdi_connection.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/interfaces/plugin/src/sensor_js.cpp b/interfaces/plugin/src/sensor_js.cpp index 263b131d..f759637e 100644 --- a/interfaces/plugin/src/sensor_js.cpp +++ b/interfaces/plugin/src/sensor_js.cpp @@ -69,7 +69,6 @@ static void DataCallbackImpl(SensorEvent *event) } if (g_onceCallbackInfos.find(sensorTypeId) == g_onceCallbackInfos.end()) { - HiLog::Debug(LABEL, "%{public}s no subscribe to the sensor data once", __func__); return; } struct AsyncCallbackInfo *onceCallbackInfo = g_onceCallbackInfos[sensorTypeId]; diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 556719c3..978d5a5e 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -308,7 +308,6 @@ void HdiConnection::ProcessDeathObserver(const wptr &object) eventCallback_ = nullptr; reconnect(); HiLog::Debug(LABEL, "%{public}s end", __func__); - } void HdiConnection::reconnect() -- Gitee