From 7377da65c35d6a6cd297bbde1f46a2cf1a1e4ab9 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Tue, 19 Mar 2024 20:18:31 +0800 Subject: [PATCH] =?utf8?q?=E7=81=B0=E5=8D=A1=E6=BC=8F=E5=85=89=E6=B5=8B?= =?utf8?q?=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp | 5 ++--- code/sdk/drivers/peripheral/utils/custom_utils.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index 3416de6e3..9523add8e 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -72,7 +72,6 @@ void CustomEventPublish(uint16_t topic, uint8_t *data , uint32_t size) Request *request = NULL; BroadcastApi *broadcastApi = NULL; IUnknown *api = NULL; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ChargerEventPublish topic=%u!!", topic); /* alloc request */ @@ -113,7 +112,7 @@ void CustomEventPublish(uint16_t topic, uint8_t *data , uint32_t size) errcode_t update_leaklight_event_notify(uint8_t *data) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "send lightdata to ui %s",data); - CustomEventPublish(TOPIC_EVENT_LEAKLIGHT_UPDATA,(uint8_t*)&data,sizeof(data)); + CustomEventPublish(TOPIC_EVENT_LEAKLIGHT_UPDATA,(uint8_t*)data,strlen((char*)data)); return 0; } errcode_t update_leaklight_event_sendmsg_toUI(uint8_t *data) @@ -128,7 +127,7 @@ errcode_t update_leaklight_event_sendmsg_toUI(uint8_t *data) errcode_t update_graycard_event_notify(uint8_t *data) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "send carddata to ui %s",data); - CustomEventPublish(TOPIC_EVENT_GRAYCARD_UPDATA,(uint8_t*)&data,sizeof(data)); + CustomEventPublish(TOPIC_EVENT_GRAYCARD_UPDATA,(uint8_t*)data,strlen((char*)data)); return 0; } errcode_t update_graycard_event_sendmsg_toUI(uint8_t *data) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index b9f1546af..395a06b7f 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -6,8 +6,8 @@ * History: \n * 2023-02-24, Create file. \n */ -#ifndef BUTTON_H -#define BUTTON_H +#ifndef CUSTOM_UTILS_H +#define CUSTOM_UTILS_H #include "hal_gpio.h" #include "soc_osal.h" -- 2.17.1