From: CCC <2393524978@qq.com> Date: Fri, 21 Jul 2023 12:23:45 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=93f99d42903255bd564efb956602cb2f018ba551;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/CMakeLists.txt b/2.sdk/sdk/gui/lv_watch/CMakeLists.txt index c145a071..45f5c776 100644 --- a/2.sdk/sdk/gui/lv_watch/CMakeLists.txt +++ b/2.sdk/sdk/gui/lv_watch/CMakeLists.txt @@ -202,6 +202,7 @@ set(lv_watch_sources mmi_location/mmi_location.c mmi_sundry/mmi_sundry.c mmi_sundry/mmi_common.c + framework/message/mmi_msg_zhsx.c #video call lv_apps/mmi_video_call/mmi_video_call.c lv_apps/mmi_video_call/mmi_jrtc_client.c diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c new file mode 100644 index 00000000..29ca5dec --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c @@ -0,0 +1,133 @@ + + + +#include "lv_watch.h" + +#ifdef __MMI_ZHSX_SUPPORT__ + + +void mmi_msg_ui_action_watch_searching(void) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + mmi_msg_watch_searching_t * msg_info = (mmi_msg_watch_searching_t *)Hal_Mem_Alloc(sizeof(mmi_msg_watch_searching_t)); + + memset(msg_info, 0x0, sizeof(mmi_msg_watch_searching_t)); + msg_info->header.MsgId = MMI_MSG_WATCH_SEARCHING; + + Hal_Send_Message((TASK_ID)gui_task_id, (void *)msg_info); +} + +#ifdef __MMI_WECHAT_SUPPORT__ +void mmi_msg_ui_action_wechat_incoming(void) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + mmi_msg_wechat_incoming_t * msg_info = (mmi_msg_wechat_incoming_t *)Hal_Mem_Alloc(sizeof(mmi_msg_wechat_incoming_t)); + + memset(msg_info, 0x0, sizeof(mmi_msg_wechat_incoming_t)); + msg_info->header.MsgId = MMI_MSG_WECHAT_INCOMING; + + Hal_Send_Message((TASK_ID)gui_task_id, (void *)msg_info); +} +#endif + +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ +void mmi_msg_ui_action_vc_call_incoming(void) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + mmi_msg_vc_incoming_t * msg_info = (mmi_msg_vc_incoming_t *)Hal_Mem_Alloc(sizeof(mmi_msg_vc_incoming_t)); + + memset(msg_info, 0x0, sizeof(mmi_msg_vc_incoming_t)); + msg_info->header.MsgId = MMI_MSG_VC_CALL_INCOMING; + //msg_info->type = type; + //strcpy(msg_info->number, number); + + Hal_Send_Message((TASK_ID)gui_task_id, (void *)msg_info); +} +#endif + + + + +#if 0 + +#define MODEM_ADP_TASK_PRIORITY 199 +MODEM_VIDEO_CALL_REG_STAT g_ModemVcRegStat = MODEM_VIDEO_CALL_REG_FAIL; + + +VOID MMI_ModemAdp_Video_Call_Init_Req(VOID) +{ + uos_create_task(MMI_ModemAdp_Video_Call_Main, NULL, 64, 4 * 1000, MODEM_ADP_TASK_PRIORITY, "modem_adpator_video_call"); +} + +static VOID MMI_ModemAdp_Video_Call_Main(VOID * para) +{ + (void)para; + voipmsg_t voipmsg; + + while(gui_task_id == NULL) { + printf("gui_task_id is NULL"); + uos_sleep(10); + } + + // get msg + while(1) { + // receive message + if(voipMsgQueReceive(&voipmsg)) { + printf("voip Q is not ready, sleep for 500ms\n"); + uos_sleep(100); + continue; + } + + switch(voipmsg.msgid) { + case VOIP_UA_EVENT_CALL_INCOMING: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_INCOMING\n", __FUNCTION__); + if((voipmsg.callname_present) && (voipmsg.uri_present)) { + MMI_Modem_Video_Call_Response_Incoming_t * Response; + + Response = (MMI_Modem_Video_Call_Response_Incoming_t *)Hal_Mem_Alloc( + sizeof(MMI_Modem_Video_Call_Response_Incoming_t)); + + strcpy(Response->callname, voipmsg.callname); + strcpy(Response->uri, voipmsg.uri); + + if(VOIP_VOICE_CALL == voipmsg.calltype) { + Response->calltype = MODEM_VIDEO_CALL_TYPE_VOICE; + } else { + Response->calltype = MODEM_VIDEO_CALL_TYPE_VIDEO; + } + + MMI_Modem_Video_Call_Response_Incoming(Response); + } else { + printf("%s, invalid MT params", __FUNCTION__); + bsapi_call_action(BARESIPAPI_REJ, BARESIPVIDMODE_INV); + } + break; + case VOIP_UA_EVENT_CALL_RINGING: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_RINGING\n", __FUNCTION__); + //play tone + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_RING); + break; + case VOIP_UA_EVENT_CALL_CLOSED: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_CLOSED\n", __FUNCTION__); + if(0 == Hal_Pm_Get_State()) { + Hal_Pm_WakeUp(); + } + + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_DISCONNECT); + break; + + default: + printf("%s voipmsg id is %d\n", __FUNCTION__, voipmsg.msgid); + break; + } + } +} +#endif + + +#endif + + diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h new file mode 100644 index 00000000..fb7a9e92 --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h @@ -0,0 +1,154 @@ + + + +#ifndef __MMI_MSG_ZHSX_H__ +#define __MMI_MSG_ZHSX_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lvgl.h" +#include "lv_watch_conf.h" +#else +#include "../../../lvgl/lvgl.h" +#include "../../../lv_watch_conf.h" +#endif + +#ifdef __MMI_ZHSX_SUPPORT__ + +void mmi_msg_ui_action_watch_searching(void); +#ifdef __MMI_WECHAT_SUPPORT__ +void mmi_msg_ui_action_wechat_incoming(void); +#endif +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ +void mmi_msg_ui_action_vc_call_incoming(void); +#endif + + + +#if 0 + +#define MODEM_ADP_TASK_PRIORITY 199 +MODEM_VIDEO_CALL_REG_STAT g_ModemVcRegStat = MODEM_VIDEO_CALL_REG_FAIL; + + +VOID MMI_ModemAdp_Video_Call_Init_Req(VOID) +{ + uos_create_task(MMI_ModemAdp_Video_Call_Main, NULL, 64, 4 * 1000, MODEM_ADP_TASK_PRIORITY, "modem_adpator_video_call"); +} + +static VOID MMI_ModemAdp_Video_Call_Main(VOID * para) +{ + (void)para; + voipmsg_t voipmsg; + + while(gui_task_id == NULL) { + printf("gui_task_id is NULL"); + uos_sleep(10); + } + + // get msg + while(1) { + // receive message + if(voipMsgQueReceive(&voipmsg)) { + printf("voip Q is not ready, sleep for 500ms\n"); + uos_sleep(100); + continue; + } + + switch(voipmsg.msgid) { + case VOIP_UA_EVENT_CALL_INCOMING: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_INCOMING\n", __FUNCTION__); + if((voipmsg.callname_present) && (voipmsg.uri_present)) { + MMI_Modem_Video_Call_Response_Incoming_t * Response; + + Response = (MMI_Modem_Video_Call_Response_Incoming_t *)Hal_Mem_Alloc( + sizeof(MMI_Modem_Video_Call_Response_Incoming_t)); + + strcpy(Response->callname, voipmsg.callname); + strcpy(Response->uri, voipmsg.uri); + + if(VOIP_VOICE_CALL == voipmsg.calltype) { + Response->calltype = MODEM_VIDEO_CALL_TYPE_VOICE; + } else { + Response->calltype = MODEM_VIDEO_CALL_TYPE_VIDEO; + } + + MMI_Modem_Video_Call_Response_Incoming(Response); + } else { + printf("%s, invalid MT params", __FUNCTION__); + bsapi_call_action(BARESIPAPI_REJ, BARESIPVIDMODE_INV); + } + break; + case VOIP_UA_EVENT_CALL_RINGING: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_RINGING\n", __FUNCTION__); + //play tone + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_RING); + break; + case VOIP_UA_EVENT_CALL_ESTABLISHED: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_ESTABLISHED\n", __FUNCTION__); + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_CONNECT); + break; + case VOIP_UA_EVENT_CALL_CLOSED: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_CLOSED\n", __FUNCTION__); + if(0 == Hal_Pm_Get_State()) { + Hal_Pm_WakeUp(); + } + + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_DISCONNECT); + break; + case VOIP_UA_EVENT_CALL_TRANSFER: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_TRANSFER\n", __FUNCTION__); + break; + case VOIP_UA_EVENT_REGISTER_OK: + printf("%s voipmsg id is VOIP_UA_EVENT_REGISTER_OK\n", __FUNCTION__); + g_ModemVcRegStat = MODEM_VIDEO_CALL_REG_OK; + break; + case VOIP_UA_EVENT_UNREGISTERING: + printf("%s voipmsg id is VOIP_UA_EVENT_UNREGISTERING\n", __FUNCTION__); + g_ModemVcRegStat = MODEM_VIDEO_CALL_REG_UNREGISTERING; + break; + case VOIP_UA_EVENT_REGISTER_FAIL: + printf("%s voipmsg id is VOIP_UA_EVENT_REGISTER_FAIL\n", __FUNCTION__); + g_ModemVcRegStat = MODEM_VIDEO_CALL_REG_FAIL; + break; + case VOIP_UA_EVENT_MWI_NOTIFY: + printf("%s voipmsg id is VOIP_UA_EVENT_MWI_NOTIFY\n", __FUNCTION__); + break; + case VOIP_UA_EVENT_AUDIO_ERROR: + printf("%s voipmsg id is VOIP_UA_EVENT_AUDIO_ERROR\n", __FUNCTION__); + break; + case VOIP_UA_EVENT_CALL_TERMINATE_BY_BOTTOM_LAYER: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_TERMINATE_BY_BOTTOM_LAYER\n", __FUNCTION__); + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_BOTTOM_ERR); + break; + case VOIP_UA_EVENT_CALL_NEED_REDIAL: + printf("%s voipmsg id is VOIP_UA_EVENT_CALL_NEED_REDIAL\n", __FUNCTION__); + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_NEED_REDIAL); + break; + case VOIP_UA_EVENT_AUTOTEST_START: + printf("%s voipmsg id is VOIP_UA_EVENT_AUTOTEST_START \n", __FUNCTION__); + if(0 == Hal_Pm_Get_State()) + Hal_Pm_WakeUp(); + MMI_Modem_Video_Call_Common_Response(MMI_MODEM_VIDEO_CALL_RESPONSE_AUTO_TEST); + break; + default: + printf("%s voipmsg id is %d\n", __FUNCTION__, voipmsg.msgid); + break; + } + } +} +#endif + + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif + + diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.h b/2.sdk/sdk/gui/lv_watch/lv_watch.h index 68e3e031..316f6e36 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.h +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.h @@ -174,6 +174,7 @@ extern "C" { #include "mmi_protocol/mmi_protocol_fzd.h" #include "mmi_protocol/mmi_protocol_sms.h" #include "mmi_sundry/mmi_sundry.h" +#include "framework/message/mmi_msg_zhsx.h" #include "lv_apps/mmi_video_call/mmi_video_call.h" #ifdef __MMI_WECHAT_SUPPORT__ #include "lv_apps/mmi_wechat/wechat.h" diff --git a/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.c b/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.c index e191bfda..96c610ea 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.c @@ -222,26 +222,32 @@ void mmi_watch_location_cell_stop(void) void mmi_watch_location_lte_cell_info_ind(app_adp_lte_cells_t *cell_list) { uint8_t i = 0; - - s_watch_location_data.cell_data.cell_num = cell_list->gncell_num; + s_watch_location_data.cell_data.mcc = cell_list->scell.mcc; s_watch_location_data.cell_data.mnc = cell_list->scell.mnc; + s_watch_location_data.cell_data.link_cell_id = cell_list->scell.cellid; + s_watch_location_data.cell_data.link_lac = cell_list->scell.tac; + s_watch_location_data.cell_data.link_rxlev = cell_list->scell.rsrp; + s_watch_location_data.cell_data.cell_num = cell_list->encell_num; for(i = 0; i < s_watch_location_data.cell_data.cell_num; i++) { - s_watch_location_data.cell_data.lac[i] = cell_list->gncell[i].lac; - s_watch_location_data.cell_data.cell_id[i] = cell_list->gncell[i].cell_id; - s_watch_location_data.cell_data.rxlev[i] = cell_list->gncell[i].rxlev; + s_watch_location_data.cell_data.lac[i] = cell_list->encell[i].tac; + s_watch_location_data.cell_data.cell_id[i] = cell_list->encell[i].cellid; + s_watch_location_data.cell_data.rxlev[i] = cell_list->encell[i].rsrp; } - + s_watch_location_cell_state = MMI_WATCH_LOCATION_STATE_SUCCESS; } void mmi_watch_location_gsm_cell_info_ind(app_adp_gsm_cells_t *cell_list) { uint8_t i = 0; - + s_watch_location_data.cell_data.mcc = cell_list->scell.mcc; s_watch_location_data.cell_data.mnc = cell_list->scell.mnc; + s_watch_location_data.cell_data.link_cell_id = cell_list->scell.cell_id; + s_watch_location_data.cell_data.link_lac = cell_list->scell.lac; + s_watch_location_data.cell_data.link_rxlev = cell_list->scell.rxlev; s_watch_location_data.cell_data.cell_num = cell_list->gncell_num; for(i = 0; i < s_watch_location_data.cell_data.cell_num; i++) { @@ -249,7 +255,7 @@ void mmi_watch_location_gsm_cell_info_ind(app_adp_gsm_cells_t *cell_list) s_watch_location_data.cell_data.cell_id[i] = cell_list->gncell[i].cell_id; s_watch_location_data.cell_data.rxlev[i] = cell_list->gncell[i].rxlev; } - + s_watch_location_cell_state = MMI_WATCH_LOCATION_STATE_SUCCESS; } diff --git a/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h b/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h index 588d4c94..54896554 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h @@ -77,12 +77,15 @@ typedef struct typedef struct { - uint8_t cell_num; uint16_t mcc; uint16_t mnc; + uint16_t link_lac; + uint32_t link_cell_id; + int16_t link_rxlev; + uint8_t cell_num; uint16_t lac[APP_ADP_MAX_GSM_NCELL_NUM]; uint32_t cell_id[APP_ADP_MAX_GSM_NCELL_NUM]; - uint8_t rxlev[APP_ADP_MAX_GSM_NCELL_NUM]; + int16_t rxlev[APP_ADP_MAX_GSM_NCELL_NUM]; } MMI_WATCH_CELL_DATA_T; typedef struct