From: timekeeper <1624952103@qq.com> Date: Fri, 15 Mar 2024 09:48:43 +0000 (+0800) Subject: 会卡测试 X-Git-Tag: release_V1.2.70_20241020_135402~1274^2~17 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=f6c4b452ba65f9f6d60301cb81413e2043d502c2;p=mirrors%2FFD230.git 会卡测试 --- diff --git a/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h b/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h index 5f5b9c856..701e46d8d 100755 --- a/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h +++ b/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h @@ -45,6 +45,7 @@ typedef enum { TOPIC_EVENT_HFP_FINISHED, TOPIC_EVENT_HFP_PHONE_TO_WATCH, TOPIC_EVENT_HFP_WATCH_TO_PHONE, + //TOPIC_EVENT_GRAYCARD_UPDATA, #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION TOPIC_EVENT_CHARGE_PLUG, TOPIC_EVENT_CHARGE_UNPLUG, @@ -55,6 +56,7 @@ typedef enum { TOPIC_EVENT_STOP_HRS_MONITORING, TOPIC_EVENT_START_SPO2_MONITORING, TOPIC_EVENT_STOP_SPO2_MONITORING, + TOPIC_EVENT_GRAYCARD_UPDATA, #endif #ifdef SUPPORT_CAT1_MODEM TOPIC_EVENT_CAT1_INCOMMING, diff --git a/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c b/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c index 564261803..15731c60e 100755 --- a/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c +++ b/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c @@ -32,6 +32,7 @@ static const TopicToCore topicToCoreArray[] = { {TOPIC_EVENT_STOP_HRS_MONITORING, A_CORE_MASK, 1}, {TOPIC_EVENT_START_SPO2_MONITORING, A_CORE_MASK, 1}, {TOPIC_EVENT_STOP_SPO2_MONITORING, A_CORE_MASK, 1}, + {TOPIC_EVENT_GRAYCARD_UPDATA, A_CORE_MASK, 1}, #endif {TOPIC_EVENT_HFP_INCOMMING, A_CORE_MASK, 1}, {TOPIC_EVENT_HFP_PHONE_ACTIVE, A_CORE_MASK, 1}, diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 26e33c2ab..6887ad526 100755 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -69,6 +69,7 @@ const PriorityMapper g_pri_mapper[] = { {TOPIC_EVENT_STOP_HRS_MONITORING, PRIORITY_TWO}, {TOPIC_EVENT_START_SPO2_MONITORING, PRIORITY_TWO}, {TOPIC_EVENT_STOP_SPO2_MONITORING, PRIORITY_TWO}, + {TOPIC_EVENT_GRAYCARD_UPDATA, PRIORITY_TWO}, #endif }; @@ -111,6 +112,7 @@ void MsgCenterSubscribe() MsgCenterSubscribeTopic(TOPIC_EVENT_STOP_HRS_MONITORING); MsgCenterSubscribeTopic(TOPIC_EVENT_START_SPO2_MONITORING); MsgCenterSubscribeTopic(TOPIC_EVENT_STOP_SPO2_MONITORING); + MsgCenterSubscribeTopic(TOPIC_EVENT_GRAYCARD_UPDATA); #endif #ifdef SUPPORT_CAT1_MODEM MsgCenterSubscribeTopic(TOPIC_EVENT_CAT1_INCOMMING); @@ -236,6 +238,19 @@ void MsgCenterNotifySPO2hProc(const Topic topic, Request* req) BloodOxygenModel::GetInstance()->UpSPO2data(sp02); } } + + +void MsgCenterNotifyCardhProc(const Topic topic, Request* req) +{ + unused(topic); + unused(req); + // if (topic == TOPIC_EVENT_SPO2_UPDATE && req != nullptr && req->data != nullptr) + // { + // u_int8_t sp02 = *((u_int8_t*)(req->data)); // 进行类型转换 + // DialModelSPO2::GetInstance()->UpdateSPO2(sp02); + // BloodOxygenModel::GetInstance()->UpSPO2data(sp02); + // } +} //穿戴状态 void MsgCenterNotifyWearStateProc(const Topic topic, Request* req) { @@ -307,6 +322,7 @@ void MsgCenterNotifyStopSPO2MonitoringProc(const Topic topic, Request* req) } } + #endif #ifdef SUPPORT_CAT1_MODEM void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) @@ -440,6 +456,7 @@ static msg_center_notify_table_t g_msg_center_notify_table[] = { {TOPIC_EVENT_STOP_HRS_MONITORING, MsgCenterNotifyStopHRMonitoringProc}, {TOPIC_EVENT_START_SPO2_MONITORING, MsgCenterNotifyStartSPO2MonitoringProc}, {TOPIC_EVENT_STOP_SPO2_MONITORING, MsgCenterNotifyStopSPO2MonitoringProc}, + {TOPIC_EVENT_GRAYCARD_UPDATA, MsgCenterNotifyCardhProc}, #endif #ifdef SUPPORT_CAT1_MODEM {TOPIC_EVENT_CAT1_INCOMMING, MsgCenterNotifyCatIncomingCallProc}, diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index b1e1c2e69..c22003bfa 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2222,6 +2222,7 @@ void hx3695_check_touch_init(void) // // 初始化调用入口函数 bool hx3695_init(WORK_MODE_T mode) { + TYHX_LOG(" hx3695_init mode : %d \n", mode); work_mode_flag = mode; @@ -2316,7 +2317,14 @@ bool hx3695_init(WORK_MODE_T mode) AGC_LOG("hx3695 check id failed!\r\n"); return false; } + TYHX_LOG(" hx3695_init mode : GRAY_CARD_MODE \n"); hx3695_factroy_test(GRAY_CARD_TEST); + + hx3695_msg_callback_t func = hx3695_get_send_msg_callback_func(); + if(func != NULL) + { + func(HX3695_MSG_TYPE_GRAYCARD_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); + } break; case FT_INT_TEST_MODE: @@ -2490,6 +2498,7 @@ void heart_rate_meas_timeout_handler(void * p_context) FT_RESULTS_t ft_result = hx3695_factroy_test(GRAY_CARD_TEST); uint8_t data[12] = {0}; memcpy(data, (void *)&ft_result.gr_data_final, 12); + // hx3695_factory_test_process(NULL, APP_FACTORY_TEST_GRAY_CARD, data); } break; diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.c index c7e559af1..2a6dd6aec 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_factory_test.c @@ -2885,7 +2885,9 @@ FT_RESULTS_t hx3695_factroy_test(TEST_MODE_t test_mode) hrsresult.leak_green = ft_result.gr_data_final; hrsresult.leak_red = ft_result.red_data_final; hrsresult.leak_ir = ft_result.ir_data_final; - TYHX_LOG("leak g=%d\r\n",hrsresult.leak_green); + TYHX_LOG("leak_green =%d\r\n",hrsresult.leak_green); + TYHX_LOG("leak_red =%d\r\n",hrsresult.leak_red); + TYHX_LOG("leak_ir =%d\r\n",hrsresult.leak_ir); break; case GRAY_CARD_TEST: hx3695_factory_ft_card_test_config(); @@ -2894,6 +2896,9 @@ FT_RESULTS_t hx3695_factroy_test(TEST_MODE_t test_mode) hrsresult.card_green = ft_result.gr_data_final; hrsresult.card_red = ft_result.red_data_final; hrsresult.card_ir = ft_result.ir_data_final; + TYHX_LOG("card_green =%d\r\n",hrsresult.card_green); + TYHX_LOG("card_red =%d\r\n",hrsresult.card_red); + TYHX_LOG("card_ir =%d\r\n",hrsresult.card_ir); break; case FT_INT_TEST: hx3695_factory_ft_int_test_config(); diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_at_cmd.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_at_cmd.cpp index e58c738b2..822406b9c 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_at_cmd.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_at_cmd.cpp @@ -95,8 +95,18 @@ static uint32_t ppg_do_test(uint8_t *para, uint32_t paraLen, char *strCommonCmd) return ERRCODE_SUCC; } +static uint32_t ppg_my_test(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + UNUSED(strCommonCmd); + printf("PPG MY TEST\n"); + return ERRCODE_SUCC; +} + + static const at_cmd_table_t g_ppg_cmd[] = { { (char *)"AT^PPGTEST", ppg_do_test, (char *)"hrs enable" }, + { (char *)"AT^PPGTEST", ppg_do_test, (char *)"graycard enable"}, + { (char *)"AT^LEAKLGIHTTEST", ppg_do_test, (char *)"leaklight enable"}, }; at_cmd_table_t *get_ppg_cmd_table(uint32_t *cmd_count) diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index a3ad04e12..9eaacc743 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -108,6 +108,18 @@ void CustomEventPublish(uint16_t topic, uint8_t *data , uint32_t size) return; } +errcode_t update_graycard_event_notify(uint8_t *data) +{ + CustomEventPublish(TOPIC_EVENT_GRAYCARD_UPDATA,(uint8_t*)&data,sizeof(data)); + return 0; +} +errcode_t update_graycard_event_sendmsg_toUI(uint8_t *data) +{ + /**通过UI事件发送Notify*/ + GraphicService::GetInstance()->PostGraphicEvent(std::bind(update_graycard_event_notify, data)); + return ERRCODE_SUCC; +} + //血氧 errcode_t update_spo2_event_notify(uint8_t spo2) @@ -153,6 +165,7 @@ errcode_t update_wearstatus_event_sendmsg_toUI(int32_t wearstatus) void hx3695_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen) { + uint8_t databuf[64] = {0}; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hx3695_msg_callback"); FT_CUSTOM_RESULTS_t sensor_data; // 使用更通用的名称 sensor_data #if 1 @@ -177,8 +190,20 @@ void hx3695_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datale update_spo2_event_sendmsg_toUI(sensor_data.lastestspo2); break; case HX3695_MSG_TYPE_LEAKLIGHT_UPDATE: + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_leak_green_UPDATE = %d", sensor_data.leak_green); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_leak_green_UPDATE = %d", sensor_data.leak_red); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_leak_green_UPDATE = %d", sensor_data.leak_ir); + // update_spo2_event_sendmsg_toUI(sensor_data.leak_green); + // update_spo2_event_sendmsg_toUI(sensor_data.leak_red); + // update_spo2_event_sendmsg_toUI(sensor_data.leak_ir); break; case HX3695_MSG_TYPE_GRAYCARD_UPDATE: + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GRAYCARD_UPDATE"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_card_green_UPDATE = %d", sensor_data.card_green); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_card_red_UPDATE = %d", sensor_data.card_red); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_card_ir_UPDATE = %d", sensor_data.card_ir); + sprintf((char *)databuf,"%d,%d,%d",sensor_data.card_green,sensor_data.card_red,sensor_data.card_ir); + update_graycard_event_sendmsg_toUI(databuf); break; case HX3695_MSG_TYPE_WEARSTAT_UPDATE: WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HX3695_MSG_TYPE_WEARSTATUS_UPDATE = %d", sensor_data.wearstatus);