From bf3c38f8c0aa5b766329dc08eddd7e3fc79ef2d2 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Fri, 17 May 2024 00:22:06 +0800 Subject: [PATCH] =?utf8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=86=85=E5=AD=98?= =?utf8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=93=9D=E7=89=99=E5=92=8C=E9=9F=B3?= =?utf8?q?=E4=B9=90task=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?utf8?q?=E9=A2=98=202=E3=80=81=E4=BC=98=E5=8C=96getUserInfo=20=E8=93=9D?= =?utf8?q?=E7=89=99=E5=8D=8F=E8=AE=AE=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=90=8C?= =?utf8?q?=E6=AD=A5=E6=AD=BB=E6=9C=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../brandy/brandy_standard/thread_init.c | 2 +- .../nativeui/config/include/ConfigModel.h | 2 +- .../service/ble_service/blemoder/bletest.cpp | 4 +- .../service/ble_service/bleservice/bleEvent.c | 68 ++++++++++++++++++- .../service/ble_service/bleservice/bleEvent.h | 2 +- .../ble_service/bleservice/bleService.c | 2 +- .../slip/cat1Service/cat1_server.cpp | 2 +- 7 files changed, 72 insertions(+), 10 deletions(-) diff --git a/code/sdk/application/brandy/brandy_standard/thread_init.c b/code/sdk/application/brandy/brandy_standard/thread_init.c index 69dfca780..5aecd9e12 100755 --- a/code/sdk/application/brandy/brandy_standard/thread_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_init.c @@ -138,7 +138,7 @@ app_task_definition_t g_app_tasks[] = { #ifdef SUPPORT_AT_CMD { { "at_cmd", 0, NULL, 0, NULL, 0x1C00, TASK_PRIORITY_APP, 0, 0 }, (osThreadFunc_t)at_cmd_task_process_handler, NULL, - (CreateQueueFunction_t)at_cmd_task_queue_init, USE_DTCM_MEM }, + (CreateQueueFunction_t)at_cmd_task_queue_init, USE_EXTEND_MEM }, #endif #if defined(SUPPORT_AT_GRAPHIC) { { "at_graphic", 0, NULL, 0, NULL, AT_GRAPHIC_STACK_SIZE, TASK_PRIORITY_APP, 0, 0 }, diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h index 8bba96423..b76451e6b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h @@ -216,7 +216,7 @@ namespace OHOS {ConfigDataType::DATATYPE_DOUBLE, "Distance", "0.0" },// CONFIGMODEL_ITEM_ACTIVITY_VALUES_DISTANCE, //活动数据运动距离 {ConfigDataType::DATATYPE_INT, "ActivityTimestamp", "0" },// CONFIGMODEL_ITEM_ACTIVITY_VALUES_TIMESTAMP, //活动数据更新时间戳 {ConfigDataType::DATATYPE_INT, "height", "175" },// CONFIGMODEL_ITEM_CUSTOM_DATA_HEIGHT, //用户数据身高 (cm)(身高)(default : 175)(30 - 300) - {ConfigDataType::DATATYPE_DOUBLE, "weight", "70.0" },// CONFIGMODEL_ITEM_CUSTOM_DATA_WEIGHT, //用户数据体重 (kg)(體重)(default : 70)(10 - 300) + {ConfigDataType::DATATYPE_INT, "weight", "70" },// CONFIGMODEL_ITEM_CUSTOM_DATA_WEIGHT, //用户数据体重 (kg)(體重)(default : 70)(10 - 300) {ConfigDataType::DATATYPE_INT, "sex", "1" },// CONFIGMODEL_ITEM_CUSTOM_DATA_SEX, //用户数据性别 (default : 1 男性)(0 : 女性, 1 : 男性) {ConfigDataType::DATATYPE_INT, "age", "30" },// CONFIGMODEL_ITEM_CUSTOM_DATA_AGE, //用户数据年龄 (年紀)(default : 30)(1 - 99) {ConfigDataType::DATATYPE_INT, "WearingMode", "0" },// CONFIGMODEL_ITEM_CUSTOM_DATA_WEARING_MODE, //用户数据佩戴方式 (default : 左手)(0 : 左手 1 : 右手) diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index 09b326ab7..8476ac98c 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -408,8 +408,7 @@ uint8_t ble_falg=0; void set_user_data(msg_user_info_t *data) { - //1.设置用户信息中 设置目标站立会大概率死机 复现方法就 set_user_data@胡传军 - return; + OHOS::ConfigModel *p_ConfigModel = OHOS::ConfigModel::GetInstance(); printf("高:%d\r\n",data->height); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_HEIGHT,data->height); @@ -421,7 +420,6 @@ void set_user_data(msg_user_info_t *data) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_AGE,data->age); printf("目标步数:%d\r\n",data->target_step); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT,data->target_step); - //目标站立 printf("目标站立 %d\r\n",data->target_stand); diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index a6c7ce191..91e2b9c05 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -1952,6 +1952,60 @@ void GetWeatherCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,ui } } + + +#if USE_PROTOCOL_EN_DE_BY_SNICKER +void getUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue)// +{ + + + printf("getUserInfo "); + for(uint8_t i = 0;iage; + msg_userinfo.fat_time = p_userinfo->fat_time; + msg_userinfo.gender = p_userinfo->gender; + msg_userinfo.height = p_userinfo->height; + msg_userinfo.target_stand = p_userinfo->target_stand; + msg_userinfo.target_step = p_userinfo->target_step; + msg_userinfo.timeformat = p_userinfo->timeformat; + msg_userinfo.weight = p_userinfo->weight; + + printf("getUserInfo:!!age %d, fat %d, sex %d, height %d, stand %d, step %d , timeformat %d , weight %d !!!!!!\r\n", + p_userinfo->age, + p_userinfo->fat_time, + p_userinfo->gender, + p_userinfo->height, + p_userinfo->target_stand, + p_userinfo->target_step, + p_userinfo->timeformat, + p_userinfo->weight + ); + + set_user_data(&msg_userinfo); + + ble_recv_msg_callback_t func = ble_recv_get_send_msg_callback_func(); + if (func !=NULL) + { + + } + + + }else{ + ble_reply_cmd(USER_INFOR_CMD,0);//crc error + } +} +#else //APP下发设置用户数据 void getUserInfo(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue)// { @@ -2011,6 +2065,7 @@ void getUserInfo(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint sendBleData(value,19); } } +#endif //APP下发快捷辅助功能参数 void get_auxil_fun_parm(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue)// { @@ -2145,15 +2200,24 @@ void getAPPaddressbook(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalDat } } + +#if USE_PROTOCOL_EN_DE_BY_SNICKER //02 类型 +void type2AE4Data(ble_read_data *buffer_handle,uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue) +#else void type2AE4Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue) +#endif { uint16_t typeID = buf_cmd[1]*256+buf_cmd[2]; printf("type2AE4Data typeID:0x%x\r\n",typeID); switch (typeID) //ID { case USER_INFOR_CMD://app下发的获取用户信息 + #if USE_PROTOCOL_EN_DE_BY_SNICKER + getUserInfo(buffer_handle,typeID,data,datalen,totalData,crcvalue); + #else getUserInfo(typeID,data,datalen,totalData,crcvalue); + #endif break; case SET_PHONE_INFOR_CMD://app下发的下发的手机信息 getPhoneInfo(typeID,data,datalen,totalData,crcvalue); @@ -5150,7 +5214,7 @@ void bleLongRecvData(ble_read_data *buffer_handle,uint8_t *data, uint16_t data_s switch (type) { case 0x02://获取手机信息 - type2AE4Data(buf_cmd,data,data_size,totalData,crcvalue); + type2AE4Data(buffer_handle,buf_cmd,data,data_size,totalData,crcvalue); break; case 0x01: type2AE3Data(buffer_handle,buf_cmd,data,data_size,totalData,crcvalue); @@ -5229,7 +5293,7 @@ errcode_t combine_data_internal(ble_read_data *buffer_handle,uint8_t *totalData, uapi_get_timestampe_ms(×tamp_ble); buffer_handle->last_timestamp = timestamp_ble; buffer_handle->totalDataLen = buffer_handle->cmd_header.total_data_len; - if (buffer_handle->totalDataLen > MAX_BLE_MSG_PACKAGE_LEN || buffer_handle->totalDataLen <= 0 ) + if (buffer_handle->totalDataLen > MAX_BLE_MSG_PACKAGE_LEN || buffer_handle->totalDataLen < 0 ) { printf("package is too lardge (%d) than (%d) or too small !\n",buffer_handle->totalDataLen,MAX_BLE_MSG_PACKAGE_LEN); return ERRCODE_FAIL; diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h index cc5d552fc..cabd8f844 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -688,7 +688,7 @@ void revBleOldData(uint8_t *buf, uint16_t event_size,uint16_t handle);//协议 // void type2AE3Data(uint8_t *cmd_buf ,uint8_t *data,uint16_t datalen,uint8_t *totaldata,uint8_t crcvalue);//对不同指令ID进行区分 void type2AE1Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue); // void type2AE0Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue); -void type2AE4Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue); +// void type2AE4Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue); void type2AE5Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue); errcode_t sendBleData(uint8_t *buf,uint16_t len); diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index fa92340eb..9e134ca8d 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -1378,7 +1378,7 @@ errcode_t uapi_blesrv_service_init(void) taskcfg.attr.priority = osPriorityNormal; taskcfg.attr.stack_size = BLESRV_APP_BOARD_TASK_SIZE; taskcfg.func = blesrv_service_check_task; - taskcfg.use_mem = USE_DTCM_MEM; + taskcfg.use_mem = USE_EXTEND_MEM; errcode_t ret = uapi_create_osThread_custom(&taskcfg); if (ret != ERRCODE_SUCC) diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 3e0170bd4..f57e7ef8c 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -869,7 +869,7 @@ errcode_t cat1_server_init(void) taskcfg.attr.priority = TASK_PRIORITY_APP; taskcfg.attr.stack_size = CAT1_SERVICE_TASK_SIZE; taskcfg.func = cat1_server_task; - taskcfg.use_mem = USE_DTCM_MEM; + taskcfg.use_mem = USE_EXTEND_MEM; errcode_t ret=uapi_create_osThread_custom(&taskcfg); if(ret != ERRCODE_SUCC) -- 2.17.1