From 7f736b54af9e6693fee736d6598928d946a16806 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Fri, 22 Aug 2025 18:11:59 +0800 Subject: [PATCH] =?utf8?q?=E8=BF=98=E5=8E=9F=E5=AE=8FSUPPORT=5FOHOSFWK?= =?utf8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=B4=BB=E5=8A=A8=E6=97=A0=E6=95=B0?= =?utf8?q?=E6=8D=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../brandy/brandy_standard/thread_init.c | 2 +- .../nativeapp/nativeui/goal/src/goalmodel.cpp | 498 +++++++++--------- .../cywee/ble_service/cywee_ble_service.c | 4 +- .../drivers/ppg/ppgBleService/ppgBleService.c | 2 +- .../ble_service/bleservice/bleService.c | 2 +- .../factorytest_service/factorytestService.c | 4 +- 6 files changed, 267 insertions(+), 245 deletions(-) diff --git a/code/sdk/application/brandy/brandy_standard/thread_init.c b/code/sdk/application/brandy/brandy_standard/thread_init.c index 328493ad0..7b35e12eb 100644 --- a/code/sdk/application/brandy/brandy_standard/thread_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_init.c @@ -192,7 +192,7 @@ app_task_definition_t g_app_tasks[] = { (osThreadFunc_t)transmit_process_thread, NULL, (CreateQueueFunction_t)transmit_thread_msg_init, USE_DTCM_MEM }, #endif -#if defined(SUPPORT_POWER_MANAGER) && !defined(SUPPORT_AT_OHOSFWK) +#if defined(SUPPORT_POWER_MANAGER) && !defined(SUPPORT_OHOSFWK) /* OHOS场景,pms不需要独立的队列和线程,事件由UI线程接管处理 */ { { "power_display", 0, NULL, 0, NULL, PM_DISPLAY_MSG_STACK_SIZE, TASK_PRIORITY_TRANSMIT, 0, 0 }, (osThreadFunc_t)power_display_msg_thread, NULL, diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/goal/src/goalmodel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/goal/src/goalmodel.cpp index 272aff00b..931040d74 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/goal/src/goalmodel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/goal/src/goalmodel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:09 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2025-08-12 10:29:17 + * @LastEditTime: 2025-08-22 18:06:14 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GoalModel.cpp */ #include "goal/include/goalmodel.h" @@ -10,14 +10,15 @@ #include "activity/include/ActivityModel.h" #include "ConfigModel.h" -// #include "cywee_hal.h" -// #include "goal_notification.h" + +#include "goal_notification.h" #include "custom_utils.h" // #include "cywee_ble_service.h" // #include "goalmodel.h" #ifdef SUPPORT_CYWEE_SERVICE #include "cywee_data.h" +#include "cywee_hal.h" #endif namespace OHOS { @@ -32,29 +33,29 @@ namespace OHOS void GoalModel::GoalModelInitdata() { - // OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES_TIME),OHOS::GOAL_CALOREIE); - // OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES_TIME),OHOS::GOAL_STAND); - // OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION_TIME),OHOS::GOAL_FAT); - // OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE_TIME),OHOS::GOAL_DISTANCE); - // OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT_TIME),OHOS::GOAL_STEP); + OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES_TIME),OHOS::GOAL_CALOREIE); + OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES_TIME),OHOS::GOAL_STAND); + OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION_TIME),OHOS::GOAL_FAT); + OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE_TIME),OHOS::GOAL_DISTANCE); + OHOS::set_Is_show_flag(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT_TIME),OHOS::GOAL_STEP); - // step_goal_show=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEP); - // other_goal_show=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER); + step_goal_show=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEP); + other_goal_show=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER); - // step_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT); - // distanc_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE); - // fat_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); - // calories_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); - // stand_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); + step_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT); + distanc_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE); + fat_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); + calories_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); + stand_goal=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); #ifdef SUPPORT_CYWEE_SERVICE standdata_now = cywee_get_now_stand_count(); #endif - // show_step=goal_parse_step_data(); - // show_calories=goal_parse_calories_data(); - // show_distance=goal_parse_distance_data(); - // show_fat=goal_parse_fat_data(); + show_step=goal_parse_step_data(); + show_calories=goal_parse_calories_data(); + show_distance=goal_parse_distance_data(); + show_fat=goal_parse_fat_data(); } @@ -296,229 +297,239 @@ namespace OHOS uint32_t GoalModel::goal_parse_step_data(void) { - // char path_[64]={0}; - // char timeday[12] = {0}; - // uapi_get_YYMMDD_Time_extend(timeday, '_',0); - // sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_PATH,timeday); - // FILE * fp = fopen(path_,"rb+"); - // uint32_t size=0; - // uint32_t toal_data=0; - - // time_t currtime; - // struct tm *timeinfo_now; - // time(&currtime); - // timeinfo_now = localtime(&currtime); - - // uint8_t mon_now=timeinfo_now->tm_mon; - // uint8_t day_now=timeinfo_now->tm_mday; - - // if (fp != NULL) - // { - // fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 - // size = ftell(fp); // 获取当前文件指针位置,即文件大小 - // fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 - // } - // else - // { - // return 0; - // } - // uint8_t *date=(uint8_t *)malloc(size); - // if(date==NULL) return 0; + char path_[64]={0}; + char timeday[12] = {0}; + uapi_get_YYMMDD_Time_extend(timeday, '_',0); +#ifdef SUPPORT_CYWEE_SERVICE + sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_PATH,timeday); +#endif + FILE * fp = fopen(path_,"rb+"); + uint32_t size=0; + uint32_t toal_data=0; + + time_t currtime; + struct tm *timeinfo_now; + time(&currtime); + timeinfo_now = localtime(&currtime); + + uint8_t mon_now=timeinfo_now->tm_mon; + uint8_t day_now=timeinfo_now->tm_mday; + + if (fp != NULL) + { + fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 + size = ftell(fp); // 获取当前文件指针位置,即文件大小 + fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 + } + else + { + return 0; + } + uint8_t *date=(uint8_t *)malloc(size); + if(date==NULL) return 0; - // fread(date,sizeof(uint8_t),size,fp); - // fclose(fp); - // int32_t sing_date=0; - // int32_t timetemp=0; + fread(date,sizeof(uint8_t),size,fp); + fclose(fp); + int32_t sing_date=0; + int32_t timetemp=0; - // for(int i=0;i0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) - // toal_data+=sing_date; - // } - // free(date); - // return toal_data; - return 0; + if(sing_date>0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) + toal_data+=sing_date; + } + free(date); + return toal_data; + // return 0; } float GoalModel::goal_parse_calories_data(void) { - // char path_[64]={0}; - // char timeday[12] = {0}; - // uapi_get_YYMMDD_Time_extend(timeday, '_',0); - // sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_CALORIES_PATH,timeday); - // FILE * fp = fopen(path_,"rb+"); - // uint32_t size=0; - // float toal_data=0; - - // time_t currtime; - // struct tm *timeinfo_now; - // time(&currtime); - // timeinfo_now = localtime(&currtime); - - // uint8_t mon_now=timeinfo_now->tm_mon; - // uint8_t day_now=timeinfo_now->tm_mday; - - // if (fp != NULL) - // { - // fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 - // size = ftell(fp); // 获取当前文件指针位置,即文件大小 - // fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 - // } - // else - // { - // return 0; - // } - // uint8_t *date=(uint8_t *)malloc(size); - // if(date==NULL) return 0; + char path_[64]={0}; + char timeday[12] = {0}; + uapi_get_YYMMDD_Time_extend(timeday, '_',0); +#ifdef SUPPORT_CYWEE_SERVICE + sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_CALORIES_PATH,timeday); +#endif + + FILE * fp = fopen(path_,"rb+"); + uint32_t size=0; + float toal_data=0; + + time_t currtime; + struct tm *timeinfo_now; + time(&currtime); + timeinfo_now = localtime(&currtime); + + uint8_t mon_now=timeinfo_now->tm_mon; + uint8_t day_now=timeinfo_now->tm_mday; + + if (fp != NULL) + { + fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 + size = ftell(fp); // 获取当前文件指针位置,即文件大小 + fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 + } + else + { + return 0; + } + uint8_t *date=(uint8_t *)malloc(size); + if(date==NULL) return 0; - // fread(date,sizeof(uint8_t),size,fp); - // fclose(fp); - // float sing_date=0; - // int32_t timetemp=0; + fread(date,sizeof(uint8_t),size,fp); + fclose(fp); + float sing_date=0; + int32_t timetemp=0; - // for(int i=0;i0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) - // toal_data+=sing_date; - // } - // free(date); - // return toal_data; - return 0; + if(sing_date>0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) + toal_data+=sing_date; + } + free(date); + return toal_data; + // return 0; } float GoalModel::goal_parse_distance_data(void) { - // char path_[64]={0}; - // char timeday[12] = {0}; - // uapi_get_YYMMDD_Time_extend(timeday, '_',0); - // sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_DISTANCE_PATH,timeday); - // FILE * fp = fopen(path_,"rb+"); - // uint32_t size=0; - // float toal_data=0; - - // time_t currtime; - // struct tm *timeinfo_now; - // time(&currtime); - // timeinfo_now = localtime(&currtime); - - // uint8_t mon_now=timeinfo_now->tm_mon; - // uint8_t day_now=timeinfo_now->tm_mday; - - // if (fp != NULL) - // { - // fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 - // size = ftell(fp); // 获取当前文件指针位置,即文件大小 - // fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 - // } - // else - // { - // return 0; - // } - // uint8_t *date=(uint8_t *)malloc(size); - // if(date==NULL) return 0; + char path_[64]={0}; + char timeday[12] = {0}; + uapi_get_YYMMDD_Time_extend(timeday, '_',0); +#ifdef SUPPORT_CYWEE_SERVICE + sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_DISTANCE_PATH,timeday); +#endif + FILE * fp = fopen(path_,"rb+"); + uint32_t size=0; + float toal_data=0; + + time_t currtime; + struct tm *timeinfo_now; + time(&currtime); + timeinfo_now = localtime(&currtime); + + uint8_t mon_now=timeinfo_now->tm_mon; + uint8_t day_now=timeinfo_now->tm_mday; + + if (fp != NULL) + { + fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 + size = ftell(fp); // 获取当前文件指针位置,即文件大小 + fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 + } + else + { + return 0; + } + uint8_t *date=(uint8_t *)malloc(size); + if(date==NULL) return 0; - // fread(date,sizeof(uint8_t),size,fp); - // fclose(fp); - // float sing_date=0; - // int32_t timetemp=0; + fread(date,sizeof(uint8_t),size,fp); + fclose(fp); + float sing_date=0; + int32_t timetemp=0; - // for(int i=0;i0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) - // toal_data+=sing_date; - // } - // free(date); - // return toal_data; - return 0; + if(sing_date>0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) + toal_data+=sing_date; + } + free(date); + return toal_data; + // return 0; } uint32_t GoalModel::goal_parse_fat_data(void) { - // char path_[64]={0}; - // char timeday[12] = {0}; - // uapi_get_YYMMDD_Time_extend(timeday, '_',0); - // sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_FAT_PATH,timeday); - // FILE * fp = fopen(path_,"rb+"); - // uint32_t size=0; - // float toal_data=0; - - // time_t currtime; - // struct tm *timeinfo_now; - // time(&currtime); - // timeinfo_now = localtime(&currtime); - - // uint8_t mon_now=timeinfo_now->tm_mon; - // uint8_t day_now=timeinfo_now->tm_mday; - - - // if (fp != NULL) - // { - // fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 - // size = ftell(fp); // 获取当前文件指针位置,即文件大小 - // fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 - // } - // else - // { - // return 0; - // } - // uint8_t *date=(uint8_t *)malloc(size); - // if(date==NULL) return 0; + char path_[64]={0}; + char timeday[12] = {0}; + uapi_get_YYMMDD_Time_extend(timeday, '_',0); +#ifdef SUPPORT_CYWEE_SERVICE + sprintf_s(path_,64,"%s%s.bin",CWM_HISTORY_DATA_FAT_PATH,timeday); +#endif + + FILE * fp = fopen(path_,"rb+"); + uint32_t size=0; + float toal_data=0; + + time_t currtime; + struct tm *timeinfo_now; + time(&currtime); + timeinfo_now = localtime(&currtime); + + uint8_t mon_now=timeinfo_now->tm_mon; + uint8_t day_now=timeinfo_now->tm_mday; + + + if (fp != NULL) + { + fseek(fp, 0, SEEK_END); // 将文件指针移动到文件末尾 + size = ftell(fp); // 获取当前文件指针位置,即文件大小 + fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 + } + else + { + return 0; + } + uint8_t *date=(uint8_t *)malloc(size); + if(date==NULL) return 0; - // fread(date,sizeof(uint8_t),size,fp); - // fclose(fp); - // uint16 sing_date=0; - // int32_t timetemp=0; + fread(date,sizeof(uint8_t),size,fp); + fclose(fp); + uint16 sing_date=0; + int32_t timetemp=0; - // for(int i=0;i0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) - // toal_data+=sing_date; - // } - // free(date); - // return toal_data; - return 0; + if(sing_date>0 && timeinfo->tm_mday==day_now && timeinfo->tm_mon==mon_now) + toal_data+=sing_date; + } + free(date); + return toal_data; + // return 0; } @@ -526,59 +537,70 @@ namespace OHOS uint32_t GoalModel::show_data_step_refresh(void) { - // int32_t value=0; - // uint32_t toal_date; + int32_t value=0; + uint32_t toal_date; - // toal_date=show_step; - // cywee_get_now_hour_data(&value,STEP); - // if(value>0) - // toal_date+=value; - // return toal_date; + toal_date=show_step; +#ifdef SUPPORT_CYWEE_SERVICE + cywee_get_now_hour_data(&value,STEP); +#endif + if(value>0) + toal_date+=value; + return toal_date; return 0; } float GoalModel::show_data_calories_refresh(void) { - // float _f_value=0; - // float toal_date; - // toal_date=show_calories; - // cywee_get_now_hour_data(&_f_value,CALORIES); - // if(_f_value>0) - // toal_date+=_f_value; + float _f_value=0; + float toal_date; + toal_date=show_calories; +#ifdef SUPPORT_CYWEE_SERVICE + cywee_get_now_hour_data(&_f_value,CALORIES); +#endif + + if(_f_value>0) + toal_date+=_f_value; - // return toal_date; + return toal_date; return 0; } float GoalModel::show_data_distance_refresh(void) { - // float _f_value=0; - // float toal_date; - // toal_date=show_distance; - // cywee_get_now_hour_data(&_f_value,DISTANCE); - // if(_f_value>0) - // toal_date+=_f_value; + float _f_value=0; + float toal_date; + toal_date=show_distance; +#ifdef SUPPORT_CYWEE_SERVICE + cywee_get_now_hour_data(&_f_value,DISTANCE); +#endif + + if(_f_value>0) + toal_date+=_f_value; - // return toal_date; + return toal_date; - return 0; + // return 0; } uint32_t GoalModel::show_data_fat_refresh(void) { - // uint16_t _16_value=0; - // uint32_t toal_date; - // toal_date=show_fat; - // cywee_get_now_hour_data(&_16_value,FAT); - // if(_16_value>0) - // toal_date+=_16_value; + uint16_t _16_value=0; + uint32_t toal_date; + toal_date=show_fat; + +#ifdef SUPPORT_CYWEE_SERVICE + cywee_get_now_hour_data(&_16_value,FAT); +#endif + if(_16_value>0) + toal_date+=_16_value; - // return toal_date; + return toal_date; - return 0; + // return 0; } diff --git a/code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_service.c b/code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_service.c index b81fc5002..a8c607ef7 100644 --- a/code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_service.c +++ b/code/sdk/zhihui/drivers/cywee/ble_service/cywee_ble_service.c @@ -12,7 +12,7 @@ #endif #include "securec.h" #include "wearable_log.h" -#ifdef SUPPORT_AT_OHOSFWK +#ifdef SUPPORT_OHOSFWK #include "BluetoothWrapper.h" #endif @@ -48,7 +48,7 @@ static void ble_cywee_add_service(uint8_t server_id) bts_data_to_uuid_len2(BLE_UUID_CYWEE_REPORT_SERVICE, &cywee_service_uuid); //只有一个服务,永远是1 errcode_t ret = 0; -#ifndef SUPPORT_AT_OHOSFWK +#ifndef SUPPORT_OHOSFWK ret = gatts_add_service(server_id, &cywee_service_uuid, true); printf("ble_cywee_add_service gatts_add_service ret: 0x%x serverId = 0x%x uuid.uuid_len:%d\n", ret, server_id,cywee_service_uuid.uuid_len); #else diff --git a/code/sdk/zhihui/drivers/ppg/ppgBleService/ppgBleService.c b/code/sdk/zhihui/drivers/ppg/ppgBleService/ppgBleService.c index f6506c23b..6827728d3 100644 --- a/code/sdk/zhihui/drivers/ppg/ppgBleService/ppgBleService.c +++ b/code/sdk/zhihui/drivers/ppg/ppgBleService/ppgBleService.c @@ -63,7 +63,7 @@ static void ble_ppgtest_add_service(uint8_t server_id) bts_data_to_uuid_len2(BLE_UUID_PPG_BLE_SERVICE, &ppgtest_service_uuid); //只有一个服务,永远是1 errcode_t ret = 0; -#ifndef SUPPORT_AT_OHOSFWK +#ifndef SUPPORT_OHOSFWK ret = gatts_add_service(server_id, &ppgtest_service_uuid, true); // printf("ble_ppgtest_add_service wrapper_gatts_add_service ret: 0x%x server_id = 0x%x uuid.uuid_len:%d\n", ret, server_id,ppgtest_service_uuid.uuid_len); #else diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleService.c b/code/sdk/zhihui/services/ble_service/bleservice/bleService.c index 04457cb9d..25a41c293 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleService.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleService.c @@ -2061,7 +2061,7 @@ void srv_ble_server_register_gatt_callbacks(void) g_ble_gatts_cbs.write_request_cb = svr_ble_bt_gatts_req_write_cb; g_ble_gatts_cbs.mtu_changed_cb = svr_ble_mtu_exchange; -#ifndef SUPPORT_AT_OHOSFWK +#ifndef SUPPORT_OHOSFWK gatts_register_callbacks(&g_ble_gatts_cbs); #else wrapper_gatts_register_callbacks(&g_ble_gatts_cbs); diff --git a/code/sdk/zhihui/services/factorytest_service/factorytestService.c b/code/sdk/zhihui/services/factorytest_service/factorytestService.c index cb7c7f0d0..c3e559e8d 100644 --- a/code/sdk/zhihui/services/factorytest_service/factorytestService.c +++ b/code/sdk/zhihui/services/factorytest_service/factorytestService.c @@ -11,7 +11,7 @@ #include "bts_gatt_server.h" #include "securec.h" #include "wearable_log.h" -#ifdef SUPPORT_AT_OHOSFWK +#ifdef SUPPORT_OHOSFWK #include "BluetoothWrapper.h" #endif @@ -52,7 +52,7 @@ static void ble_factorytest_add_service(uint8_t server_id) bts_data_to_uuid_len2(BLE_UUID_ATE_FACTORYTEST_SERVICE, &factory_service_uuid); //只有一个服务,永远是1 errcode_t ret = 0; -#ifndef SUPPORT_AT_OHOSFWK +#ifndef SUPPORT_OHOSFWK ret = gatts_add_service(server_id, &factory_service_uuid, true); // printf("ble_factorytest_add_service gatts_add_service ret: 0x%x serverId = 0x%x uuid.uuid_len:%d\n", ret, server_id,factory_service_uuid.uuid_len); #else -- 2.17.1