blob: fe2cb6fa29f52302f50fabd92a7e46d5f145fc4c [file] [log] [blame]
xf.libfc6e712025-02-07 01:54:34 -08001
2#include <limits.h>
3#include "sms_code.h"
4#include <sys/msg.h>
5T_zUfiSms_ConcatInfo g_zUfiSms_ConcatSms;T_zUfiSms_GroupInfo g_zUfiSms_GroupSms;
6T_zUfiSms_DbStoreData g_zUfiSms_DbStoreData[ZTE_WMS_CONCAT_SMS_COUNT_MAX];UINT8
7g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_MAX]={FALSE,FALSE};T_zUfiSms_DelSms
8g_zUfiSms_DelMsg;T_zUfiSms_DelIndexInfo g_deleteIndex={(0x11ab+5072-0x257b)};
9T_zUfiSms_ModifySms g_zUfiSms_modifyMsg={(0x13a1+2914-0x1f03)};
10T_zUfiSms_ModifyIndexInfo g_modifyIndex={(0xb83+6302-0x2421)};int
11g_zUfiSms_UnitLen=(0x1755+2050-0x1f57);int g_zUfiSms_ConcatTotalNum=
12(0x114+3667-0xf67);int g_zUfiSms_CurConcatSegNo=(0x1494+4280-0x254c);UINT8
13g_zUfiSms_IsConcatSendSuc=TRUE;int g_zUfiSms_SendFailedCount=(0xdb0+4655-0x1fdf)
14;int g_zUfiSms_MsgRefer=(0xbe1+1037-0xfee);int g_zUfiSms_SendFailedRetry=
15(0x2dc+5290-0x1786);char g_Zmena_value[(0xf5a+1876-0x16ac)]={(0xc87+4385-0x1da8)
16};int g_displaymode=(0xf63+981-0x1338);extern SMS_LOCATION g_zUfiSms_CurLocation
17;extern T_zUfiSms_CmdStatus zUfiSms_HandleReport(unsigned char*ptPduData);extern
18 void zUfiSms_GetReportStatus(char*pdu_tmp,int*stat);extern VOID
19zUfiSms_ResendAtCmdZmena(int cid);extern int zUfiSms_DecodeSmsData(
20T_zUfiSms_DbStoreData*pDb_Data,int msg_index,zUfiSms_StoreType iStorePos,
21T_SmsStatus bSms_Status,wms_message_format_enum_v01 format,long iPdu_Len,
22unsigned char*pPdu_Received);typedef struct{long mtype;char mtext[
23(0xc44+918-0xfce)];}FOTA_MSG_BUF;
24#define WEBUI_NOTIFY_PUSH_MSG_ (0x3e4+5049-0x179a)
25typedef struct{unsigned int isread_record;unsigned int inbox_full;}
26T_zUfiMmi_SmsRecord;void zUfiMmi_SendSmsStatus(void){int iSmsNum=
27(0x43d+5275-0x18d8);T_zUfiMmi_SmsRecord tRecord={(0x1e7+8202-0x21f1)};CHAR
28smsNum[(0xe6+3806-0xf92)]={(0x1de5+2272-0x26c5)};sc_cfg_get(NV_SMS_IN_NUM,smsNum
29,sizeof(smsNum));iSmsNum=atoi(smsNum);tRecord.isread_record=zUfiSms_IsUnreadSms(
30ZTE_WMS_MEMORY_MAX);if(iSmsNum>=ZSMS_NUM_MAX_CPE){tRecord.inbox_full=
31(0x101b+2079-0x1839);}else{tRecord.inbox_full=(0xb43+1124-0xfa7);}}VOID
32zUfiSms_Init(VOID){zUfiSms_CfgInit();zUfiSms_ChangeMainState(SMS_STATE_INITING);
33}VOID zSvr_Zpbic_Sms_Init(VOID){int atRes=(0x1425+3977-0x23ae);
34T_zUfiSms_StatusInfo tStatus={(0xb58+2689-0x15d9)};CHAR outDate[
35(0xe37+6067-0x25b8)]={(0x638+2049-0xe39)};zUfiSms_Init();zUfiSms_InitCmdStatus(&
36tStatus,WMS_SMS_CMD_INIT);zSms_SendSmsInitReq();at_print(LOG_DEBUG,
37"corem zSvr_Zpbic_Sms_Init has send init req\n");zSms_SendZmenaReq(
38(0x8fc+7037-0x2479));at_print(LOG_DEBUG,
39"\x63\x6f\x72\x65\x6d\x20\x7a\x53\x76\x72\x5f\x5a\x70\x62\x69\x63\x5f\x53\x6d\x73\x5f\x49\x6e\x69\x74\x20\x68\x61\x73\x20\x73\x65\x6e\x64\x20\x7a\x6d\x65\x6e\x61\x20\x72\x65\x71" "\n"
40);sc_cfg_get(NV_OUTDATE_DELETE,outDate,sizeof(outDate));at_print(LOG_DEBUG,
41"\x63\x6f\x72\x65\x6d\x20\x7a\x53\x76\x72\x5f\x5a\x70\x62\x69\x63\x5f\x53\x6d\x73\x5f\x49\x6e\x69\x74\x20\x6f\x75\x74\x64\x61\x74\x65\x20\x63\x68\x65\x63\x6b\x20\x25\x73" "\n"
42,outDate);if((0x488+714-0x752)==strcmp(outDate,"\x31")){atWeb_OutdateSmsCheck(
43ZUFI_NULL);}}VOID zUfiSms_DeleteAllSimSms(VOID){zUfiSms_DeleteAllSimSmsInDb();}
44#if (0xd69+3281-0x1a3a)
45VOID zUfiSms_ResendAtCmdZmena(int cid){CHAR netType[(0x14b4+2675-0x1ef5)]={
46(0x7b2+2096-0xfe2)};sc_cfg_get(NV_NETWORK_TYPE,netType,sizeof(netType));if(!
47g_Zmena_rsp&&((0x1515+3-0x1518)!=strcmp(
48"\x4e\x6f\x20\x53\x65\x72\x76\x69\x63\x65",netType)&&(0x1019+5417-0x2542)!=
49strcmp("\x4c\x69\x6d\x69\x74\x65\x64\x20\x53\x65\x72\x76\x69\x63\x65",netType)))
50{atUnsoli_Report_Zmena(NULL,cid);}}
51#endif
52void zUfiSms_Ack_new_msg(BOOL needAck){
53#if (0x13f7+3455-0x2176)
54CHAR ackPduStr[(0x15e0+691-0x1703)]={(0x1c4+8832-0x2444)};SMS_PARAM reportParam=
55{(0x1aac+1494-0x2082)};int total_length=(0x6dc+147-0x76f);UINT8 TP_FCS=
56(0x2f5+8132-0x22b9);CHAR strValue[(0x10af+3716-0x1f31)]={(0x12a5+782-0x15b3)};if
57(needAck){TP_FCS=(0x1021+3013-0x1be6);sprintf(strValue,"\x25\x64",
58(0xdda+1677-0x1466));}else{TP_FCS=(0x1a8+8976-0x23e5);sprintf(strValue,
59"\x25\x64",(0x1c31+584-0x1e77));}sprintf(reportParam.SCA,"\x25\x73",cfg_get(
60"\x73\x6d\x73\x5f\x63\x65\x6e\x74\x65\x72\x5f\x6e\x75\x6d"));total_length=
61zUfiSms_EncodePdu_DeliverReport(&reportParam,ackPduStr,TP_FCS);memset(&
62g_zUfiSms_ackPdu,(0xdaf+5972-0x2503),sizeof(g_zUfiSms_ackPdu));g_zUfiSms_ackPdu.
63length=String2Bytes(ackPduStr,g_zUfiSms_ackPdu.pdu,strlen(ackPduStr));memset(
64g_zUfiSms_ackPdu.pdu,(0x90d+2911-0x146c),sizeof(g_zUfiSms_ackPdu.pdu));memcpy(&
65g_zUfiSms_ackPdu.pdu,&ackPduStr,sizeof(ackPduStr));atBase_SendMsgToSelf(
66ZAT_CNMA_CMD,strValue,sizeof(strValue));
67#endif
68#if (0x72a+5465-0x1c83)
69CHAR strValue[(0xe55+4258-0x1ef5)]={(0x1132+167-0x11d9)};if(needAck){snprintf(
70strValue,sizeof(strValue),"\x25\x64",(0x1276+2761-0x1d3e));}else{snprintf(
71strValue,sizeof(strValue),"\x25\x64",(0x15c8+1400-0x1b3e));}zSvr_InnerSendMsg(
72ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,MSG_CMD_AT_CNMA,strlen(strValue
73),strValue);
74#endif
75if(needAck){zSms_SendCnmaReq((0x1136+5367-0x262c));}else{zSms_SendCnmaReq(
76(0xd58+317-0xe93));}}T_zUfiSms_CmdStatus zUfiSms_SendRawSms(T_zUfiSms_SendReq*
77ptSendMsg){if(NULL==ptSendMsg||(0x57a+6022-0x1d00)==ptSendMsg->receiver_count){
78return WMS_CMD_FAILED;}at_print(LOG_DEBUG,
79"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x52\x61\x77\x53\x6d\x73\x20\x72\x65\x63\x65\x69\x76\x65\x72\x5f\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2f\x64\x65\x73\x74\x5f\x6e\x75\x6d\x3a\x25\x73\x2f\x6d\x73\x67\x5f\x6c\x65\x6e\x3a\x25\x64\x2f\x69\x64\x3a\x25\x64\x2e" "\n"
80,ptSendMsg->receiver_count,ptSendMsg->dest_num[(0xe43+5767-0x24ca)],ptSendMsg->
81msg_len,ptSendMsg->id);
82#if (0xe94+287-0xfb2)
83at_print(LOG_DEBUG,
84"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x52\x61\x77\x53\x6d\x73\x20\x64\x63\x73\x3a\x25\x64" "\n"
85,ptSendMsg->dcs);
86#endif
87sc_cfg_set(NV_SMS_SEND_RESULT,"");g_zUfiSms_SendFailedCount=(0x6ad+3566-0x149b);
88if(ptSendMsg->isDelete==TRUE||-(0x1379+2062-0x1b86)!=ptSendMsg->id){(void)
89zUfiSms_DeleteDraftSms(ptSendMsg->id);}zUfiSms_SetGlobalDcsLang(ptSendMsg->dcs);
90memset(&g_zUfiSms_GroupSms,(0xa63+4849-0x1d54),sizeof(g_zUfiSms_GroupSms));if(
91ZUFI_FAIL==zUfiSms_FillGroupSms(ptSendMsg,&g_zUfiSms_GroupSms)){return
92WMS_CMD_FAILED;}memset(&g_zUfiSms_ConcatSms,(0x50+3418-0xdaa),sizeof(
93g_zUfiSms_ConcatSms));g_zUfiSms_UnitLen=zUfiSms_FillConcatSms(ptSendMsg,&
94g_zUfiSms_ConcatSms);g_zUfiSms_IsConcatSendSuc=TRUE;g_zUfiSms_CurConcatSegNo=
95(0x11ec+683-0x1497);memset(g_zUfiSms_DbStoreData,(0xff+6232-0x1957),sizeof(
96g_zUfiSms_DbStoreData));if(ptSendMsg->mem_store==(0x4fb+2182-0xd77)){
97g_displaymode=(0x852+6110-0x202f);at_print(LOG_DEBUG,
98"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x53\x6d\x73\x3a\x20\x6d\x73\x67\x5f\x64\x69\x73\x70\x6c\x61\x79\x6d\x6f\x64\x65\x20\x3d\x20\x31" "\n"
99);}else{g_displaymode=(0x40d+1942-0xba3);at_print(LOG_DEBUG,
100"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x53\x6d\x73\x3a\x20\x6d\x73\x67\x5f\x64\x69\x73\x70\x6c\x61\x79\x6d\x6f\x64\x65\x20\x3d\x20\x30" "\n"
101);}return zUfiSms_SendSms();}T_zUfiSms_CmdStatus zUfiSms_WriteRawSms(
102T_zUfiSms_SaveReq*pSaveBuff){T_zUfiSms_ConcatInfo tConcatSms;T_zUfiSms_GroupInfo
103 tGroupSms;int iSmsLen=(0x742+2786-0x1224);T_zUfiSms_CmdStatus result=
104WMS_CMD_SUCCESS;if(NULL==pSaveBuff){return WMS_CMD_FAILED;}if(
105g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_NV]){at_print(LOG_DEBUG,
106"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x6e\x76\x20\x6d\x65\x6d\x6f\x72\x79\x20\x69\x73\x20\x66\x75\x6c\x6c\x2c\x72\x65\x74\x75\x72\x6e" "\n"
107);return WMS_CMD_FAILED;}if(pSaveBuff->isDelete==TRUE){(void)
108zUfiSms_DeleteDraftSms(pSaveBuff->id);}zUfiSms_SetGlobalDcsLang(pSaveBuff->dcs);
109memset(&tConcatSms,(0x1c6+351-0x325),sizeof(T_zUfiSms_ConcatInfo));memset(&
110tGroupSms,(0x764+922-0xafe),sizeof(T_zUfiSms_GroupInfo));(void)
111zUfiSms_FillGroupSms(pSaveBuff,&tGroupSms);iSmsLen=zUfiSms_FillConcatSms(
112pSaveBuff,&tConcatSms);at_print(LOG_DEBUG,
113"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x74\x6f\x74\x61\x6c\x5f\x72\x65\x63\x65\x69\x76\x65\x72\x3d\x25\x64\x2c\x69\x53\x6d\x73\x4c\x65\x6e\x3d\x25\x64" "\n"
114,tGroupSms.total_receiver,iSmsLen);for(tGroupSms.current_receiver=
115(0x1960+1255-0x1e47);tGroupSms.current_receiver<tGroupSms.total_receiver;
116tGroupSms.current_receiver++){tConcatSms.current_sending=(0xd41+1574-0x1367);
117result=zUfiSms_SaveSmsToDb(pSaveBuff,&tConcatSms,&tGroupSms,iSmsLen);at_print(
118LOG_DEBUG,
119"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x63\x75\x72\x72\x65\x6e\x74\x5f\x72\x65\x63\x65\x69\x76\x65\x72\x3d\x25\x64\x2c\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
120,tGroupSms.current_receiver,result);}sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");
121zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);if(g_zUfiSms_MemFullFlag[
122WMS_STORAGE_TYPE_NV_V01]){zUfiSms_SendSmsStatusInfo(MSG_SMS_DEFAULT);}at_print(
123LOG_DEBUG,
124"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x65\x6e\x64\x20\x61\x6e\x64\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
125,result);return result;}T_zUfiSms_CmdStatus zUfiSms_DeleteSms(T_zUfiSms_DelReq*
126ptDelBuff){T_zUfiSms_CmdStatus result=WMS_CMD_SUCCESS;BOOL
127memoryFullbeforeDelete=FALSE;BOOL unreadBeforeDelete=FALSE;if(NULL==ptDelBuff){
128return WMS_CMD_FAILED;}at_print(LOG_DEBUG,
129"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x6d\x73\x21\x21\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2f\x69\x64\x5b\x25\x64\x5d\x2e" "\n"
130,ptDelBuff->all_or_count,ptDelBuff->id[(0x114b+3604-0x1f5f)]);(void)
131zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(
132SMS_STATE_DELING);memset(&g_zUfiSms_DelMsg,(0x1c66+202-0x1d30),sizeof(
133T_zUfiSms_DelSms));if(ZUFI_FAIL==zUfiSms_SetDeleteInfo(ptDelBuff)){at_print(
134LOG_DEBUG,
135"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x74\x44\x65\x6c\x65\x74\x65\x49\x6e\x66\x6f\x20\x66\x61\x69\x6c\x2e" "\n"
136);zUfiSms_ChangeMainState(SMS_STATE_DELED);return WMS_CMD_FAILED;}at_print(
137LOG_DEBUG,
138"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x74\x44\x65\x6c\x65\x74\x65\x49\x6e\x66\x6f\x20\x52\x65\x61\x64\x20\x74\x6f\x20\x44\x65\x6c\x65\x74\x65\x3a\x6e\x76\x5f\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2f\x73\x69\x6d\x5f\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2e" "\n"
139,g_zUfiSms_DelMsg.nv_count,g_zUfiSms_DelMsg.sim_count);if((0x980+2743-0x1437)<
140g_zUfiSms_DelMsg.nv_count){if(g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]){
141memoryFullbeforeDelete=TRUE;}unreadBeforeDelete=zUfiSms_IsUnreadSms(
142ZTE_WMS_MEMORY_NV);result=(T_zUfiSms_CmdStatus)zUfiSms_DeleteNvSms();(void)
143zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(
144SMS_STATE_DELED);sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");at_print(LOG_DEBUG,
145"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x20\x6d\x65\x6d\x6f\x72\x79\x46\x75\x6c\x6c\x62\x65\x66\x6f\x72\x65\x44\x65\x6c\x65\x74\x65\x3d\x25\x64\x2c\x4d\x65\x6d\x46\x75\x6c\x6c\x46\x6c\x61\x67\x28\x4e\x56\x29\x3d\x25\x64" "\n"
146,memoryFullbeforeDelete,g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]);if(
147memoryFullbeforeDelete&&!g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]){
148at_print(LOG_DEBUG,
149"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x3a\x20\x73\x65\x6e\x64\x20\x41\x54\x2b\x5a\x4d\x45\x4e\x41\x3d\x30" "\n"
150);zSms_SendZmenaReq((0xd95+2081-0x15b6));}if(memoryFullbeforeDelete&&!
151g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]||unreadBeforeDelete&&!
152zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){zUfiSms_SendSmsStatusInfo(
153MSG_SMS_DEFAULT);}}if((0x391+5270-0x1827)<g_zUfiSms_DelMsg.sim_count){result=
154zUfiSms_DeleteSimSms();(void)zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_SIM);}
155at_print(LOG_DEBUG,
156"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x6d\x73\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
157,result);return result;}T_zUfiSms_CmdStatus zUfiSms_ModifySmsTag(
158T_zUfiSms_ModifyFlag*ptModifyBuff){unsigned long i=(0x67d+78-0x6cb);
159T_zUfiSms_CmdStatus result=WMS_CMD_SUCCESS;char acStorePos[(0xa4b+2857-0x1542)]=
160{(0x6ca+3788-0x1596)};if(NULL==ptModifyBuff){at_print(LOG_ERR,
161"\x69\x6e\x70\x75\x74\x73\x20\x69\x73\x20\x6e\x75\x6c\x6c\x2e");return
162WMS_CMD_FAILED;}for(i=(0x2db+3157-0xf30);i<ptModifyBuff->total_id;i++){if(
163ptModifyBuff->id[i]<(0xcfa+5204-0x214d)||ZUFI_FAIL==zUfiSms_UpdateSmsTagInDb(
164ptModifyBuff->id[i],ptModifyBuff->tags)){result=WMS_CMD_FAILED;}else{result=
165WMS_CMD_SUCCESS;}}if(ZUFI_FAIL==zUfiSms_GetStorePosById(
166"\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65",acStorePos,sizeof(acStorePos),
167ptModifyBuff->id[(0x1b6+2999-0xd6d)])){return ZUFI_FAIL;}if((0x18ec+1375-0x1e4b)
168==strcmp(acStorePos,ZTE_WMS_DB_NV_TABLE)){zUfiSms_SendSmsStatusInfo(
169MSG_SMS_READING);}if((0xae9+3027-0x16bc)==strcmp(acStorePos,ZTE_WMS_DB_SIM_TABLE
170)&&ptModifyBuff->total_id>(0x594+4811-0x185f)){zUfiSms_ModifyModemSms(
171ptModifyBuff);}return result;}T_zUfiSms_CmdStatus zUfiSms_SetSmsPara(
172T_zUfiSms_ParaInfo*ptParaBuff){int atRes=(0xe21+2138-0x167b);CHAR sca[
173ZTE_WMS_ADDRESS_DIGIT_MAX_V01+(0x1283+3113-0x1eab)]={(0x93d+4710-0x1ba3)};CHAR
174store[(0x9f2+2095-0x120d)]={(0x14a+1509-0x72f)};CHAR defaultStore[
175(0x217+4442-0x133f)]={(0xbb+7806-0x1f39)};if(ptParaBuff==ZUFI_NULL){return
176WMS_CMD_FAILED;}if(strlen(ptParaBuff->sca)!=(0x1260+2650-0x1cba)){strncpy(sca,
177ptParaBuff->sca,sizeof(sca)-(0x6bc+1352-0xc03));at_print(LOG_DEBUG,
178"\x73\x65\x6e\x64\x20\x5a\x41\x54\x5f\x43\x53\x43\x41\x5f\x53\x45\x54\x5f\x43\x4d\x44\x20\x6d\x65\x73\x73\x61\x67\x65\x20\x63\x73\x63\x61\x20\x69\x73\x20\x25\x73\x2e" "\n"
179,sca);atRes=zSms_SetCscaReq(ptParaBuff->sca);if(atRes!=ZSMS_RESULT_OK){return
180WMS_CMD_FAILED;}}sc_cfg_get(NV_DEFAULT_STORE,defaultStore,sizeof(defaultStore));
181if((*(ptParaBuff->default_store)!='\0')&&((0x3c+2694-0xac2)!=strcmp(defaultStore
182,ptParaBuff->default_store))){{strncpy(store,ptParaBuff->default_store,sizeof(
183store)-(0x884+5123-0x1c86));}atRes=zSms_SendCnmiReq(store);if(atRes!=
184ZSMS_RESULT_OK){return WMS_CMD_FAILED;}}if(-(0x846+6859-0x2310)==
185zUfiSms_SetDbParameters(ptParaBuff)){at_print(LOG_ERR,
186"\x73\x65\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x74\x6f\x20\x74\x61\x62\x6c\x65\x20\x66\x61\x69\x6c\x65\x64\x2e"
187);return WMS_CMD_FAILED;}return WMS_CMD_SUCCESS;}void zUfiSms_CmgrNvSet(void){
188char sms_rec_flag[(0x16d+1853-0x8a5)]={(0x897+3326-0x1595)};char remind_flag[
189(0xbe3+1705-0x1287)];int sms_count=(0x88b+3327-0x158a);int remind_count=
190(0xa91+674-0xd33);memset(sms_rec_flag,(0x1171+425-0x131a),sizeof(sms_rec_flag));
191sc_cfg_get(ZTE_WMS_NVCONFIG_RECEVIED,sms_rec_flag,sizeof(sms_rec_flag));
192sms_count=atoi(sms_rec_flag);if(sms_count<(0x3d7+5576-0x199f)||sms_count>INT_MAX
193-(0xe8a+1188-0x132d)){at_print(LOG_ERR,
194"\x5b\x53\x4d\x53\x5d\x73\x6d\x73\x5f\x63\x6f\x75\x6e\x74\x20\x65\x72\x72\x3a\x25\x64" "\n"
195,sms_count);return;}memset(sms_rec_flag,(0x987+2733-0x1434),sizeof(sms_rec_flag)
196);snprintf(sms_rec_flag,sizeof(sms_rec_flag),"\x25\x64",sms_count+
197(0x93d+5305-0x1df5));sc_cfg_set(ZTE_WMS_NVCONFIG_RECEVIED,sms_rec_flag);
198sc_cfg_set(ZTE_WMS_NVCONFIG_RECEVIED_LED,sms_rec_flag);memset(remind_flag,
199(0x1003+3708-0x1e7f),sizeof(remind_flag));snprintf(remind_flag,sizeof(
200remind_flag),"\x25\x64",remind_count+(0x38+9457-0x2528));sc_cfg_set(
201ZTE_WMS_NVCONFIG_RECEVIED_REMIND,remind_flag);sc_cfg_set(NV_SMS_RECV_RESULT,
202"\x6f\x6b");sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");}void zUfiSms_CdsRespProc(
203T_zSms_SmsInd*ptRespData){unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
204(0x9ea+4102-0x19f0)};T_zUfiSms_DbStoreData tDbStoreData={(0xe76+2412-0x17e2)};
205int isPushSms=(0x381+247-0x478);if(strcmp(ptRespData->pdu,"")==
206(0x1052+195-0x1115)){CHAR srState[(0xac9+1469-0x1054)]={(0x1c56+180-0x1d0a)};
207sc_cfg_get(NV_SR_STATE,srState,sizeof(srState));if((0x82f+5473-0x1d90)!=strcmp(
208srState,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
209NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
210;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
211return;}zUfiSms_GetReportStatus(ptRespData->pdu,&ptRespData->stat);(void)
212String2Bytes(ptRespData->pdu,acFormatPdu,(int)strlen(ptRespData->pdu));if(
213(0xce3+2467-0x1681)==ptRespData->stat){(void)zUfiSms_HandleReport(acFormatPdu);
214sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");
215zUfiSms_Ack_new_msg(TRUE);return;}return;}int zUfiSms_CheckIfWholeSms(
216T_zUfiSms_DbStoreData*data,SMS_MSG_INFO*pmsg){if(data->concat_sms!=
217(0x617+4819-0x18e9)){return(0x3ac+8367-0x245b);}zUfiSms_GetCurrentRecvTotalSeq(
218data,pmsg);at_print(LOG_DEBUG,
219"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x68\x65\x63\x6b\x49\x66\x57\x68\x6f\x6c\x65\x53\x6d\x73\x20\x69\x64\x20\x3d\x20\x25\x73\x2c\x20\x74\x6f\x74\x61\x6c\x53\x65\x71\x20\x3d\x20\x25\x64\x2c\x72\x65\x66\x20\x3d\x25\x64\x2c\x74\x6f\x74\x61\x6c\x20\x3d\x25\x64\x2c\x20\x73\x65\x71\x3d\x25\x64" "\n"
220,pmsg->id,atoi(pmsg->total_seq),data->concat_info[(0x147+7478-0x1e7d)],data->
221concat_info[(0xad8+5057-0x1e98)],data->concat_info[(0x7c6+2218-0x106e)]);if(data
222->concat_info[(0x5d5+1524-0xbc8)]==atoi(pmsg->total_seq)){return
223(0x685+4804-0x1949);}return-(0x5b3+8404-0x2686);}void
224zUfiSms_TrafficChangeSmsTag(T_zUfiSms_DbStoreData*data){CHAR smsNumber[
225(0x672+7618-0x2402)]={(0x15f0+3582-0x23ee)};sc_cfg_get(NV_TRAFFIC_SMS_NUMBER,
226smsNumber,sizeof(smsNumber));if((0xaa4+35-0xac7)==strcmp(smsNumber,data->number)
227){data->tag=WMS_TAG_TYPE_MT_READ_V01;data->msg_displaymode=(0x114f+5388-0x265a);
228}}void zUfiSms_HandleTrafficSms(T_zUfiSms_DbStoreData*data){int iSmsId=
229(0x1257+4896-0x2577);SMS_MSG_INFO msg={(0xa77+520-0xc7f)};CHAR smsNumber[
230(0x55f+4296-0x15f5)]={(0xb36+726-0xe0c)};sc_cfg_get(NV_TRAFFIC_SMS_NUMBER,
231smsNumber,sizeof(smsNumber));at_print(LOG_DEBUG,
232"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x74\x44\x62\x53\x74\x6f\x72\x65\x44\x61\x74\x61\x2e\x6e\x75\x6d\x62\x65\x72\x20\x3d\x20\x25\x73\x2c\x20\x74\x72\x61\x66\x66\x69\x63\x5f\x73\x6d\x73\x5f\x6e\x75\x6d\x62\x65\x72\x20\x3d\x20\x25\x73" "\n"
233,data->number,smsNumber);if((0x4e3+3708-0x135f)==strcmp(smsNumber,data->number))
234{if((0xa9a+6219-0x22e5)!=zUfiSms_CheckIfWholeSms(data,&msg)){at_print(LOG_DEBUG,
235"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x63\x6d\x74\x20\x69\x6e\x64\x2c\x20\x72\x65\x63\x76\x20\x73\x6d\x73\x2c\x20\x62\x75\x74\x20\x6e\x6f\x74\x20\x77\x68\x6f\x6c\x65\x20\x73\x6d\x73\x2c\x20\x77\x61\x69\x74\x20\x74\x6f\x20\x72\x65\x63\x76\x20\x6e\x65\x78\x74\x20\x73\x65\x67" "\n"
236);return;}sc_cfg_set(NV_TRAFFIC_RECV_SMS_ID,msg.id);sc_cfg_set(
237NV_TRAFFIC_SMS_NUMBER,"\x30");at_print(LOG_DEBUG,
238"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x48\x61\x6e\x64\x6c\x65\x54\x72\x61\x66\x66\x69\x63\x53\x6d\x73\x20\x20\x20\x74\x72\x61\x66\x66\x69\x63\x5f\x72\x65\x63\x76\x5f\x73\x6d\x73\x5f\x69\x64\x20\x3d\x20\x25\x73" "\n"
239,msg.id);}}void zUfiSms_CmtRespProc(T_zSms_SmsInd*ptRespData){zUfiSms_StoreType
240iStorePos=WMS_STORAGE_TYPE_NV_V01;unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
241(0xeef+2228-0x17a3)};T_zUfiSms_DbStoreData tDbStoreData;int isPushSms=
242(0x1781+1027-0x1b84);SMS_PARAM one_sms={(0x176b+2186-0x1ff5)};int
243unread_sms_before_recv_new_sms=(0x8ab+123-0x926);memset(&tDbStoreData,
244(0x1497+3887-0x23c6),sizeof(T_zUfiSms_DbStoreData));at_print(LOG_DEBUG,
245"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2f\x70\x64\x75\x3a\x25\x73\x21" "\n"
246,ptRespData->index,ptRespData->stat,ptRespData->length,ptRespData->pdu);if(
247strcmp(ptRespData->pdu,"")==(0x48a+576-0x6ca)){CHAR srState[(0x358+391-0x4ad)]={
248(0xa85+1245-0xf62)};sc_cfg_get(NV_SR_STATE,srState,sizeof(srState));if(
249(0x1667+1461-0x1c1c)!=strcmp(srState,
250"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
251NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
252;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
253return;}isPushSms=DecodePushPdu(ptRespData->pdu,&one_sms);at_print(LOG_DEBUG,
254"\x5b\x73\x6d\x73\x5d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x20\x25\x64" "\n"
255,isPushSms);if(SMS_NOTIFICATION==isPushSms){BakNotificationSms(one_sms.TP_UD,
256strlen(one_sms.TP_UD));zte_fota_notifyPushMsg((0x2413+502-0x2609));}if(
257SMS_NO_PUSH!=isPushSms){at_print(LOG_DEBUG,
258"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64" "\n"
259,one_sms.index);at_print(LOG_DEBUG,
260"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
261,one_sms.TP_ReferNum);at_print(LOG_DEBUG,
262"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x41\x6c\x6c\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
263,one_sms.TP_AllPieceNum);at_print(LOG_DEBUG,
264"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x43\x75\x72\x72\x65\x6e\x74\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
265,one_sms.TP_CurrentPieceNum);zUfiSms_ChangeMainState(SMS_STATE_RECVED);
266zUfiSms_Ack_new_msg(TRUE);return;}zUfiSms_GetReportStatus(ptRespData->pdu,&
267ptRespData->stat);(void)String2Bytes(ptRespData->pdu,acFormatPdu,(int)strlen(
268ptRespData->pdu));if((0xfd9+1406-0x1552)==ptRespData->stat){(void)
269zUfiSms_HandleReport(acFormatPdu);sc_cfg_set(NV_SR_STATE,
270"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");zUfiSms_Ack_new_msg(TRUE);return
271;}(void)zUfiSms_DecodeSmsData(&tDbStoreData,ptRespData->index,iStorePos,(
272T_SmsStatus)ptRespData->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,ptRespData->length,
273acFormatPdu);if(tDbStoreData.sms_class==WMS_MESSAGE_CLASS_2){iStorePos=
274WMS_STORAGE_TYPE_UIM_V01;}if(zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){
275unread_sms_before_recv_new_sms=(0x131d+1448-0x18c4);}else{
276unread_sms_before_recv_new_sms=(0x39c+2825-0xea5);}zUfiSms_TrafficChangeSmsTag(&
277tDbStoreData);if(ZTE_WMS_NV_MEMORY_FULL==zUfiSms_WriteSmsToDb(&tDbStoreData,
278iStorePos,-(0x1a58+1345-0x1f98))){zUfiSms_Ack_new_msg(FALSE);zSms_SendZmenaReq(
279(0x16f4+787-0x1a06));return;}if(tDbStoreData.sms_class!=WMS_MESSAGE_CLASS_2){
280zUfiSms_Ack_new_msg(TRUE);}zUfiSms_CmgrNvSet();zUfiSms_CheckMemoryFull(
281ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(SMS_STATE_RECVED);
282zUfiSms_SendSmsStatusInfo(MSG_SMS_NEW);zUfiSms_HandleTrafficSms(&tDbStoreData);
283return;}void zUfiSms_ZmgrRespProc(T_zSms_SmsInd*ptRespData){zUfiSms_StoreType
284iStorePos=WMS_STORAGE_TYPE_NV_V01;unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
285(0x19b6+1348-0x1efa)};T_zUfiSms_DbStoreData tDbStoreData;int isPushSms=
286(0x2f9+4293-0x13be);SMS_PARAM one_sms={(0xb03+5728-0x2163)};CHAR defaultStore[
287(0x1154+5303-0x25d9)]={(0x1c2+572-0x3fe)};memset(&tDbStoreData,
288(0x3bd+4483-0x1540),sizeof(T_zUfiSms_DbStoreData));at_print(LOG_DEBUG,
289"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2f\x70\x64\x75\x3a\x25\x73\x21" "\n"
290,ptRespData->index,ptRespData->stat,ptRespData->length,ptRespData->pdu);if(
291strcmp(ptRespData->pdu,"")==(0xa8b+6603-0x2456)){CHAR srState[
292(0x16ac+918-0x1a10)]={(0x607+2098-0xe39)};sc_cfg_get(NV_SR_STATE,srState,sizeof(
293srState));if((0xdb4+4069-0x1d99)!=strcmp(srState,
294"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
295NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
296;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
297return;}isPushSms=DecodePushPdu(ptRespData->pdu,&one_sms);at_print(LOG_DEBUG,
298"\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x20\x25\x64" "\n"
299,isPushSms);at_print(LOG_DEBUG,
300"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x25\x64\x20" "\n"
301,isPushSms);if(SMS_NOTIFICATION==isPushSms){BakNotificationSms(one_sms.TP_UD,
302strlen(one_sms.TP_UD));zte_fota_notifyPushMsg((0xb0a+6584-0x24c2));}if(
303SMS_NO_PUSH!=isPushSms){at_print(LOG_DEBUG,
304"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64" "\n"
305,one_sms.index);at_print(LOG_DEBUG,
306"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
307,one_sms.TP_ReferNum);at_print(LOG_DEBUG,
308"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x41\x6c\x6c\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
309,one_sms.TP_AllPieceNum);at_print(LOG_DEBUG,
310"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x43\x75\x72\x72\x65\x6e\x74\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
311,one_sms.TP_CurrentPieceNum);zUfiSms_ChangeMainState(SMS_STATE_RECVED);return;}
312zUfiSms_GetReportStatus(ptRespData->pdu,&ptRespData->stat);(void)String2Bytes(
313ptRespData->pdu,acFormatPdu,(int)strlen(ptRespData->pdu));if(
314(0x1208+4515-0x23a6)==ptRespData->stat){(void)zUfiSms_HandleReport(acFormatPdu);
315sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");return;}
316sc_cfg_get(NV_DEFAULT_STORE,defaultStore,sizeof(defaultStore));if(
317(0x62+2104-0x89a)==strcmp(defaultStore,"\x73\x69\x6d")){iStorePos=
318WMS_STORAGE_TYPE_UIM_V01;}(void)zUfiSms_DecodeSmsData(&tDbStoreData,ptRespData->
319index,iStorePos,(T_SmsStatus)ptRespData->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,
320ptRespData->length,acFormatPdu);if(tDbStoreData.sms_class==WMS_MESSAGE_CLASS_2){
321iStorePos=WMS_STORAGE_TYPE_UIM_V01;}zUfiSms_TrafficChangeSmsTag(&tDbStoreData);
322if(ZTE_WMS_NV_MEMORY_FULL==zUfiSms_WriteSmsToDb(&tDbStoreData,iStorePos,-
323(0x297+4578-0x1478))){return;}if(tDbStoreData.sms_class!=WMS_MESSAGE_CLASS_2){}
324zUfiSms_CmgrNvSet();zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);
325zUfiSms_ChangeMainState(SMS_STATE_RECVED);zUfiSms_HandleTrafficSms(&tDbStoreData
326);return;}void zUfiSms_CmgrRespProc(T_zSms_SmsInd*ptRespData){zUfiSms_StoreType
327iStorePos=WMS_STORAGE_TYPE_NV_V01;unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
328(0x8b7+7273-0x2520)};T_zUfiSms_DbStoreData tDbStoreData;int isPushSms=
329(0x54a+8076-0x24d6);SMS_PARAM one_sms={(0x125b+1354-0x17a5)};int
330unread_sms_before_recv_new_sms=(0x4aa+5375-0x19a9);memset(&tDbStoreData,
331(0xda9+3736-0x1c41),sizeof(T_zUfiSms_DbStoreData));at_print(LOG_DEBUG,
332"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2f\x70\x64\x75\x3a\x25\x73\x21" "\n"
333,ptRespData->index,ptRespData->stat,ptRespData->length,ptRespData->pdu);
334zUfiSms_SendSmsStatusInfo(MSG_SMS_READING);if(strcmp(ptRespData->pdu,"")==
335(0x1001+3027-0x1bd4)){CHAR srState[(0x21cf+916-0x2531)]={(0x1840+2664-0x22a8)};
336sc_cfg_get(NV_SR_STATE,srState,sizeof(srState));if((0x696+1415-0xc1d)!=strcmp(
337srState,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
338NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
339;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
340return;}isPushSms=DecodePushPdu(ptRespData->pdu,&one_sms);at_print(LOG_DEBUG,
341"\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x20\x25\x64" "\n"
342,isPushSms);at_print(LOG_DEBUG,
343"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x25\x64\x20" "\n"
344,isPushSms);if(SMS_NOTIFICATION==isPushSms){BakNotificationSms(one_sms.TP_UD,
345strlen(one_sms.TP_UD));zte_fota_notifyPushMsg((0x301+6959-0x1e30));}if(
346SMS_NO_PUSH!=isPushSms){at_print(LOG_DEBUG,
347"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64" "\n"
348,one_sms.index);at_print(LOG_DEBUG,
349"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
350,one_sms.TP_ReferNum);at_print(LOG_DEBUG,
351"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x41\x6c\x6c\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
352,one_sms.TP_AllPieceNum);at_print(LOG_DEBUG,
353"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x43\x75\x72\x72\x65\x6e\x74\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
354,one_sms.TP_CurrentPieceNum);zUfiSms_ChangeMainState(SMS_STATE_RECVED);return;}
355zUfiSms_GetReportStatus(ptRespData->pdu,&ptRespData->stat);(void)String2Bytes(
356ptRespData->pdu,acFormatPdu,(int)strlen(ptRespData->pdu));if(
357(0x135f+3869-0x2277)==ptRespData->stat){(void)zUfiSms_HandleReport(acFormatPdu);
358sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");return;}(
359void)zUfiSms_DecodeSmsData(&tDbStoreData,ptRespData->index,iStorePos,(
360T_SmsStatus)ptRespData->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,ptRespData->length,
361acFormatPdu);if(tDbStoreData.sms_class==WMS_MESSAGE_CLASS_2){iStorePos=
362WMS_STORAGE_TYPE_UIM_V01;}if(zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){
363unread_sms_before_recv_new_sms=(0xf71+5803-0x261b);}else{
364unread_sms_before_recv_new_sms=(0xd67+1763-0x144a);}if(ZTE_WMS_NV_MEMORY_FULL==
365zUfiSms_WriteSmsToDb(&tDbStoreData,iStorePos,-(0xc16+328-0xd5d))){return;}if(
366tDbStoreData.sms_class!=WMS_MESSAGE_CLASS_2){}zUfiSms_CmgrNvSet();
367zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(
368SMS_STATE_RECVED);return;}void zUfiSms_CmgsRespProc(VOID){T_zUfiSms_StatusInfo
369tStatusInfo={(0x700+2008-0xed8)};g_zUfiSms_DbStoreData->msg_displaymode=
370g_displaymode;if(g_zUfiSms_DbStoreData->msg_displaymode!=(0x1bbc+2507-0x2586)){
371if((0x1bd4+1105-0x2025)==zUfiSms_WriteSmsToDb(&g_zUfiSms_DbStoreData[
372g_zUfiSms_CurConcatSegNo-(0x35f+2529-0xd3f)],WMS_STORAGE_TYPE_NV_V01,-
373(0x183+1522-0x774))){g_zUfiSms_MsgRefer++;(void)zUfiSms_SetMaxReference(
374g_zUfiSms_MsgRefer);}}printf(
375"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x67\x73\x52\x73\x70\x20\x73\x65\x67\x4e\x6f\x3a\x25\x64\x2f\x54\x6f\x74\x61\x6c\x4e\x75\x6d\x3a\x25\x64\x2f\x46\x61\x69\x6c\x4e\x75\x6d\x3a\x25\x64\x2e" "\n"
376,g_zUfiSms_CurConcatSegNo,g_zUfiSms_ConcatTotalNum,g_zUfiSms_SendFailedCount);if
377(g_zUfiSms_CurConcatSegNo==g_zUfiSms_ConcatTotalNum){g_zUfiSms_CurConcatSegNo=
378(0x362+8307-0x23d5);memset((void*)&tStatusInfo,(0x183+5112-0x157b),sizeof(
379T_zUfiSms_StatusInfo));tStatusInfo.err_code=ZTE_SMS_CMS_NONE;tStatusInfo.
380send_failed_count=g_zUfiSms_SendFailedCount;tStatusInfo.delete_failed_count=
381(0x866+7294-0x24e4);if(g_zUfiSms_SendFailedCount==(0xa62+1848-0x119a)){
382tStatusInfo.cmd_status=WMS_CMD_SUCCESS;sc_cfg_set(NV_SMS_SEND_RESULT,"\x6f\x6b")
383;}else{tStatusInfo.cmd_status=WMS_CMD_FAILED;sc_cfg_set(NV_SMS_SEND_RESULT,
384"\x66\x61\x69\x6c");}tStatusInfo.cmd=WMS_SMS_CMD_MSG_SEND;(void)
385zUfiSms_SetCmdStatus(&tStatusInfo);sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");
386zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);if(g_zUfiSms_MemFullFlag[
387WMS_STORAGE_TYPE_NV_V01]){zUfiSms_SendSmsStatusInfo(MSG_SMS_DEFAULT);}}else{}}
388int zte_fota_notifyPushMsg(int cmd){FOTA_MSG_BUF msg={(0x8f+7512-0x1de7)};int
389errs=(0x5a0+6377-0x1e89);key_t req_id=ftok(
390"\x2f\x6d\x65\x64\x69\x61\x2f\x7a\x74\x65\x2f\x7a\x74\x65\x5f\x73\x6f\x63\x6b\x65\x74\x2f\x66\x6f\x74\x61\x5f\x64\x6d\x61\x70\x70\x5f\x6d\x73\x67"
391,(0x138f+1262-0x187c));int msgid=msgget(req_id,(0x205+558-0x433));if(msgid!=-
392(0x334+1294-0x841)){msg.mtype=(0x6c3+245-0x7b7);msg.mtext[(0x1a46+1438-0x1fe4)]=
393WEBUI_NOTIFY_PUSH_MSG_;errs=msgsnd(msgid,&msg,sizeof(msg)-sizeof(long),
394(0x42a+6169-0x1c43));}return(errs<(0x505+8564-0x2679)?(0x13c8+4378-0x24e2):
395(0x556+5523-0x1ae8));}
396#if (0x979+7072-0x2519)
397int atSms_SendCmglReq(PSTR pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){return
398zSvr_SendAtSyn(ZAT_CMGL_CMD,"\x41\x54\x2b\x43\x4d\x47\x4c\x3d\x30" "\r\n",cid,
399pAtRst,atRstSize);}VOID atSms_RecvCmglRsp(T_zAt_AtRes*pResLine){return;}
400#endif
401#if (0x1aa5+1940-0x2239)
402int atSms_SendZmglReq(PSTR pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){int res
403=(0x9cf+952-0xd87);pthread_mutex_lock(&smsdb_mutex);res=zSvr_SendAtSyn(
404ZAT_ZMGL_CMD,"\x41\x54\x2b\x5a\x4d\x47\x4c\x3d\x34" "\r\n",cid,pAtRst,atRstSize)
405;pthread_mutex_unlock(&smsdb_mutex);return res;}VOID atSms_initAtOk(VOID){
406T_zUfiSms_StatusInfo tStatus={(0x374+3933-0x12d1)};sc_cfg_set(NV_SMS_LOAD_RESULT
407,"\x6f\x6b");tStatus.cmd_status=WMS_CMD_SUCCESS;tStatus.cmd=WMS_SMS_CMD_INIT;(
408void)zUfiSms_SetCmdStatus(&tStatus);zUfiSms_ChangeMainState(SMS_STATE_LOADED);}
409int atSms_initAtErr(UINT8*pErrCode){T_zUfiSms_StatusInfo tStatus={
410(0xec4+2318-0x17d2)};sc_cfg_set(NV_SMS_LOAD_RESULT,"\x66\x61\x69\x6c");
411zUfiSms_ChangeMainState(SMS_STATE_LOADED);tStatus.cmd_status=WMS_CMD_FAILED;
412tStatus.cmd=WMS_SMS_CMD_INIT;(void)zUfiSms_SetCmdStatus(&tStatus);return FALSE;}
413VOID atSms_RecvZmglRsp(T_zAt_AtRes*pResLine){static T_zUfiSms_SmsItem tSmsPara={
414(0x157f+1247-0x1a5e)};printf(
415"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x6c\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
416,pResLine->pduFlag,pResLine->result);if(pResLine->pduFlag==ZAT_ATRES_PDU_FLAG){
417zUfiSms_CmglRespProc(pResLine,&tSmsPara);}else{memset(&tSmsPara,
418(0x10e5+5423-0x2614),sizeof(T_zUfiSms_SmsItem));(void)zUfiSms_FormatSms(pResLine
419->resParas,sizeof(pResLine->resParas),&tSmsPara,(0x9a5+4514-0x1b46));printf(
420"\x5b\x53\x4d\x53\x5d\x20\x5a\x6d\x67\x6c\x20\x52\x65\x73\x70\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
421,tSmsPara.index,tSmsPara.stat,tSmsPara.length);}}int atSms_SendCmgrReq(PSTR
422pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){CHAR pAtcmdStr[(0x443+8871-0x26d6)
423]={(0xd5d+4902-0x2083)};iSmsIndex=atoi(pAtCmdPara);printf(
424"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x72\x52\x65\x71\x20\x47\x65\x74\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2e" "\n"
425,iSmsIndex);snprintf(pAtcmdStr,sizeof(pAtcmdStr),
426"\x41\x54\x2b\x43\x4d\x47\x52\x3d\x25\x73" "\r\n",pAtCmdPara);return
427zSvr_SendAtSyn(ZAT_CMGR_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID
428atSms_RecvCmgrRsp(T_zAt_AtRes*pResLine){
429#if (0x917+2861-0x1444)
430static T_zUfiSms_SmsItem tSmsPara={(0x172b+1529-0x1d24)};T_zUfiSms_CmgrSetRsp
431tCmgrRsp={(0x150c+400-0x169c)};printf(
432"\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x67\x72\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x50\x61\x72\x61\x73\x3a\x25\x73\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
433,pResLine->pduFlag,pResLine->resParas,pResLine->result);if(pResLine->pduFlag==
434ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->result){printf(
435"\x21\x21\x21\x21\x21\x21\x21\x21\x21\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x67\x72\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
436);return;}tCmgrRsp.index=tSmsPara.index;tCmgrRsp.length=tSmsPara.length;tCmgrRsp
437.stat=tSmsPara.stat;sscanf(pResLine->resParas,"\x25\x35\x30\x30\x73",tCmgrRsp.
438pdu);zUfiSms_CmgrRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();sc_cfg_set(
439"\x73\x6d\x73\x5f\x72\x65\x63\x76\x5f\x72\x65\x73\x75\x6c\x74","\x6f\x6b");}else
440{memset(&tSmsPara,(0x1307+4716-0x2573),sizeof(T_zUfiSms_SmsItem));(void)
441zUfiSms_FormatSms(pResLine->resParas,&tSmsPara,(0x733+6534-0x20b7));tSmsPara.
442index=iSmsIndex;printf(
443"\x3d\x3d\x3d\x3d\x3d\x3d\x43\x6d\x67\x72\x20\x52\x65\x73\x70\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
444,tSmsPara.index,tSmsPara.stat,tSmsPara.length);}
445#endif
446}int atSms_SendZmgrReq(PSTR pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){CHAR
447pAtcmdStr[(0x12ec+4760-0x2570)]={(0x1e5a+1155-0x22dd)};iSmsIndex=atoi(pAtCmdPara
448);printf(
449"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x5a\x6d\x67\x72\x52\x65\x71\x20\x47\x65\x74\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2e" "\n"
450,iSmsIndex);snprintf(pAtcmdStr,sizeof(pAtcmdStr),
451"\x41\x54\x2b\x5a\x4d\x47\x52\x3d\x25\x73" "\r\n",pAtCmdPara);return
452zSvr_SendAtSyn(ZAT_ZMGR_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID
453atSms_RecvZmgrOk(T_zAt_AtRes*pResLine,UINT8*nextAt){return;}VOID
454atSms_RecvZmgrErr(T_zAt_AtRes*pResLine,UINT8*nextAt){at_print(LOG_DEBUG,
455"\x53\x4d\x53\x20\x7a\x6d\x67\x72\x20\x69\x73\x20\x66\x61\x69\x6c" "\n");
456at_print(LOG_DEBUG
457"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x45\x72\x72\x20\x20\x53\x4d\x53\x20\x7a\x6d\x67\x72\x20\x69\x73\x20\x66\x61\x69\x6c" "\n"
458);{sc_cfg_set(NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(
459SMS_STATE_RECVED);}}VOID atSms_RecvZmgrRsp(T_zAt_AtRes*pResLine){static
460T_zUfiSms_SmsItem tSmsPara={(0x753+3546-0x152d)};T_zUfiSms_CmgrSetRsp tCmgrRsp={
461(0x1ef3+1207-0x23aa)};printf(
462"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x50\x61\x72\x61\x73\x3a\x25\x73\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
463,pResLine->pduFlag,pResLine->resParas,pResLine->result);if(pResLine->pduFlag==
464ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->result){printf(
465"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
466);return;}tCmgrRsp.index=tSmsPara.index;tCmgrRsp.length=tSmsPara.length;tCmgrRsp
467.stat=tSmsPara.stat;sscanf(pResLine->resParas,"\x25\x35\x30\x30\x73",tCmgrRsp.
468pdu);zUfiSms_ZmgrRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();sc_cfg_set(
469NV_SMS_RECV_RESULT,"\x6f\x6b");}else{memset(&tSmsPara,(0x164+6948-0x1c88),sizeof
470(T_zUfiSms_SmsItem));(void)zUfiSms_FormatSms(pResLine->resParas,sizeof(pResLine
471->resParas),&tSmsPara,(0x1d1b+2531-0x26fc));tSmsPara.index=iSmsIndex;printf(
472"\x5b\x53\x4d\x53\x5d\x20\x5a\x6d\x67\x72\x20\x52\x65\x73\x70\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
473,tSmsPara.index,tSmsPara.stat,tSmsPara.length);}}int atSms_SendCmgdReq(PSTR
474pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){CHAR pAtcmdStr[(0x27d+4796-0x1525)
475]={(0x97d+1670-0x1003)};snprintf(pAtcmdStr,sizeof(pAtcmdStr),
476"\x41\x54\x2b\x43\x4d\x47\x44\x3d\x25\x73" "\r\n",pAtCmdPara);return
477zSvr_SendAtSyn(ZAT_CMGD_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID
478atSms_RecvCmgdOk(VOID){CHAR strUsed[(0x1690+1574-0x1cac)]={(0x913+4519-0x1aba)};
479int used=(0x1bd3+2499-0x2596);sc_cfg_set(NV_SMS_DEL_RESULT,"\x6f\x6b");printf(
480"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x73\x69\x6d\x5f\x64\x65\x6c\x5f\x72\x65\x73\x75\x6c\x74\x20\x74\x6f\x20\x4f\x4b\x2e\x20" "\n"
481);sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));used=atoi(
482strUsed)-(0x9c0+3095-0x15d6);if(used<(0x1763+1318-0x1c89)){used=
483(0x114c+1414-0x16d2);}memset(&strUsed,(0x7c+677-0x321),(0x152f+1998-0x1cf3));
484snprintf(strUsed,sizeof(strUsed),"\x25\x64",used);sc_cfg_set(
485ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed);}VOID atSms_RecvCmgdErr(VOID){sc_cfg_set
486(NV_SMS_DEL_RESULT,"\x66\x61\x69\x6c");printf(
487"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x73\x69\x6d\x5f\x64\x65\x6c\x5f\x72\x65\x73\x75\x6c\x74\x20\x74\x6f\x20\x66\x61\x69\x6c\x2e\x20" "\n"
488);}VOID atSms_RecvCmgdFinish(VOID){char StrValue[(0x206f+386-0x21e7)]={
489(0xacb+3889-0x19fc)};CHAR strTotal[(0x156b+799-0x1880)]={(0x192c+1325-0x1e59)};
490CHAR strUsed[(0xa58+4353-0x1b4f)]={(0x34c+8283-0x23a7)};int total=
491(0x1064+5727-0x26c3);int used=(0xe0d+3097-0x1a26);int remain=(0x430+258-0x532);
492sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));used=atoi(
493strUsed);sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_TOTAL,strTotal,sizeof(strTotal));
494total=atoi(strTotal);remain=total-used;if(remain<(0xa0+7377-0x1d71)){remain=
495(0xf35+1527-0x152c);}memset(&StrValue,(0x1482+3767-0x2339),(0x4c+8372-0x20f6));
496snprintf(StrValue,sizeof(StrValue),"\x25\x64",remain);sc_cfg_set(
497ZTE_WMS_NVCONFIG_SIM_CARD_REMAIN,StrValue);printf(
498"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x69\x6d\x53\x6d\x73\x20\x75\x73\x65\x64\x3d\x25\x64\x2c\x72\x65\x6d\x61\x69\x6e\x3d\x25\x64\x2c\x74\x6f\x74\x61\x6c\x3d\x25\x64" "\n"
499,used,remain,total);zUfiSms_ChangeMainState(SMS_STATE_DELED);sc_cfg_set(
500NV_SMS_DB_CHANGE,"\x31");}int atSms_SendCmgsReq(PSTR pAtCmdPara,int cid,PSTR
501pAtRst,int atRstSize){int atRes=(0xe4b+3483-0x1be6);CHAR pAtcmdStr[ZSMS_PDU_SIZE
502]={(0xba+3074-0xcbc)};snprintf(pAtcmdStr,sizeof(pAtcmdStr),
503"\x41\x54\x2b\x43\x4d\x47\x53\x3d\x25\x64" "\r\n",g_zUfiSms_FinalCmgsBuf.length)
504;atRes=zSvr_SendAtSyn(ZAT_CMGS_CMD,pAtcmdStr,cid,pAtRst,atRstSize);if(atRes!=
505ZAT_RESULT_SMS){return atRes;}memset(pAtcmdStr,(0x190c+644-0x1b90),ZSMS_PDU_SIZE
506);if(strlen(g_zUfiSms_FinalCmgsBuf.pdu)<ZSMS_PDU_SIZE-(0x12dc+1160-0x1763)){
507memcpy(pAtcmdStr,g_zUfiSms_FinalCmgsBuf.pdu,strlen(g_zUfiSms_FinalCmgsBuf.pdu));
508}else{printf(
509"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n"
510,g_zUfiSms_FinalCmgsBuf.pdu);memcpy(pAtcmdStr,g_zUfiSms_FinalCmgsBuf.pdu,
511ZSMS_PDU_SIZE-(0x610+601-0x867));}*(pAtcmdStr+strlen(g_zUfiSms_FinalCmgsBuf.pdu)
512)=ZSMS_CTRL_Z_CHAR;memset(pAtRst,(0xb7+1731-0x77a),atRstSize);return
513zSvr_SendAtSyn(ZAT_CMGS_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID
514atSms_RecvCmgsOk(UINT8*pResLine,int cid){at_print(LOG_DEBUG,
515"\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x73\x75\x63\x63\x65\x73\x73\x2e\x20" "\n"
516);g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo>
517ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_DbStoreData[
518g_zUfiSms_CurConcatSegNo-(0x17d+9261-0x25a9)].tag=WMS_TAG_TYPE_MO_SENT_V01;
519zUfiSms_CmgsRespProc(cid);}VOID atSms_RecvCmgsErr(UINT8*pResLine,int cid){
520at_print(LOG_DEBUG,
521"\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x66\x61\x69\x6c\x2e\x20" "\n");
522g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo>
523ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_SendFailedCount++;at_print(
524LOG_DEBUG,
525"\x73\x65\x6e\x64\x20\x73\x6d\x73\x20\x66\x61\x69\x6c\x65\x64\x2c\x73\x6f\x20\x77\x72\x69\x74\x65\x20\x73\x6d\x73\x20\x74\x6f\x20\x64\x72\x61\x66\x74\x62\x6f\x78\x2e" "\n"
526);g_zUfiSms_DbStoreData[g_zUfiSms_CurConcatSegNo-(0x5bc+3822-0x14a9)].tag=
527WMS_TAG_TYPE_MO_NOT_SENT_V01;if(g_zUfiSms_ConcatTotalNum>(0x1198+3115-0x1dc2)){
528g_zUfiSms_IsConcatSendSuc=FALSE;}zUfiSms_CmgsRespProc(cid);}VOID
529atSms_RecvCmgsRsp(T_zAt_AtRes*pResLine){return;}VOID atSms_RecvCmtRsp(
530T_zAt_AtRes*pResLine){CHAR needSMS[(0x10b5+773-0x1388)]={(0x209+3612-0x1025)};
531sc_cfg_get(NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0xe41+3041-0x1a22)==
532strcmp(needSMS,"\x6e\x6f")){printf(
533"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
534);return;}static T_zUfiSms_SmsItem tSmsPara={(0x19d9+2833-0x24ea)};
535T_zUfiSms_CmtSetRsp tCmtRsp={(0xab0+4246-0x1b46)};if(NULL==pResLine){return;}
536printf(
537"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x50\x61\x72\x61\x73\x3a\x25\x73\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
538,pResLine->pduFlag,pResLine->resParas,pResLine->result);if(pResLine->pduFlag==
539ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->result){printf(
540"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
541);return;}tCmtRsp.length=tSmsPara.length;sscanf(pResLine->resParas,
542"\x25\x35\x30\x30\x73",tCmtRsp.pdu);pthread_mutex_lock(&smsdb_mutex);
543zUfiSms_CmtRespProc(&tCmtRsp);zUfiMmi_SendSmsStatus();pthread_mutex_unlock(&
544smsdb_mutex);sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}else{memset(&tSmsPara,
545(0xb79+3209-0x1802),sizeof(T_zUfiSms_SmsItem));atBase_PreProcRes(pResLine->
546resParas,sizeof(pResLine->resParas));printf(
547"\x5b\x53\x4d\x53\x5d\x20\x63\x6d\x74\x20\x69\x6e\x64\x21\x20\x70\x52\x65\x73\x4c\x69\x6e\x65\x2d\x3e\x72\x65\x73\x50\x61\x72\x61\x73\x3a\x25\x73\x2e" "\n"
548,pResLine->resParas);sscanf(pResLine->resParas,"\x25\x73\x20\x25\x64",tSmsPara.
549alpha,&tSmsPara.length);printf(
550"\x5b\x53\x4d\x53\x5d\x20\x63\x6d\x74\x20\x69\x6e\x64\x21\x20\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
551,tSmsPara.length);}}VOID atSms_RecvCmtiRsp(T_zAt_AtRes*pResLine){CHAR needSMS[
552(0x3a+4255-0x10a7)]={(0x1997+2178-0x2219)};sc_cfg_get(NV_NEED_SUPPORT_SMS,
553needSMS,sizeof(needSMS));if((0x1f9+9003-0x2524)==strcmp(needSMS,"\x6e\x6f")){
554printf(
555"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
556);return;}char sms_Main_state[(0xe6f+3877-0x1d76)]={(0x12b9+2632-0x1d01)};char*
557memory=NULL;printf(
558"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x20\x65\x6e\x74\x65\x72\x20\x25\x73\x2e" "\n"
559,pResLine->resParas);if(NULL==pResLine){return;}if(ZAT_CMTI_CMD!=pResLine->
560atCmdId){return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));
561if(strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")==
562(0x1246+1277-0x1743)){printf(
563"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x3a\x20\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67" "\n"
564);return;}memory=strstr(pResLine->resParas,"\"");if(NULL!=memory){memory++;}if(
565(0x7+3385-0xd40)==strncmp("\x53\x4d",memory,(0x14e2+4183-0x2537))){
566zUfiSms_SetSmsLocation(SMS_LOCATION_SIM);zUfiSms_ChangeMainState(
567SMS_STATE_RECVING);memory+=(0x682+7316-0x2312);printf(
568"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x6e\x64\x20\x63\x6d\x67\x72\x3a\x20\x25\x73" "\n"
569,memory);zSvr_InnerSendMsg(ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,
570MSG_CMD_AT_ZMGR,strlen(memory),memory);}else{printf(
571"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x20\x3a\x73\x74\x6f\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x6e\x6f\x74\x20\x53\x4d\x2e" "\n"
572);}sc_cfg_set(NV_SMS_RECV_RESULT,"");}VOID atSms_RecvCdsRsp(T_zAt_AtRes*pResLine
573){CHAR needSMS[(0x1429+2746-0x1eb1)]={(0x519+4865-0x181a)};sc_cfg_get(
574NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x1537+3158-0x218d)==strcmp(
575needSMS,"\x6e\x6f")){printf(
576"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
577);return;}static T_zUfiSms_SmsItem tSmsPara={(0x1867+1625-0x1ec0)};
578T_zUfiSms_CmgrSetRsp tCmgrRsp={(0x276+5695-0x18b5)};if(NULL==pResLine){return;}
579if(pResLine->pduFlag==ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->
580result){printf(
581"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
582);return;}tCmgrRsp.length=tSmsPara.length;sscanf(pResLine->resParas,
583"\x25\x35\x30\x30\x73",tCmgrRsp.pdu);pthread_mutex_lock(&smsdb_mutex);
584zUfiSms_CdsRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();pthread_mutex_unlock(&
585smsdb_mutex);sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}else{memset(&tSmsPara,
586(0x1472+4760-0x270a),sizeof(T_zUfiSms_SmsItem));atBase_PreProcRes(pResLine->
587resParas,sizeof(pResLine->resParas));printf(
588"\x5b\x53\x4d\x53\x5d\x20\x63\x64\x73\x20\x69\x6e\x64\x21\x20\x70\x52\x65\x73\x4c\x69\x6e\x65\x2d\x3e\x72\x65\x73\x50\x61\x72\x61\x73\x3a\x25\x73\x2e" "\n"
589,pResLine->resParas);sscanf(pResLine->resParas,"\x25\x73\x20\x25\x64",tSmsPara.
590alpha,&tSmsPara.length);printf(
591"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x52\x73\x70\x20\x63\x64\x73\x20\x69\x6e\x64\x21\x20\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
592,tSmsPara.length);}}VOID atSms_RecvCdsiRsp(T_zAt_AtRes*pResLine){CHAR needSMS[
593(0x1fdf+312-0x20e5)]={(0x14b8+3005-0x2075)};sc_cfg_get(NV_NEED_SUPPORT_SMS,
594needSMS,sizeof(needSMS));if((0x506+2099-0xd39)==strcmp(needSMS,"\x6e\x6f")){
595printf(
596"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
597);return;}char sms_Main_state[(0x1419+153-0x1494)]={(0x182b+2074-0x2045)};char*
598memory=NULL;printf(
599"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x20\x65\x6e\x74\x65\x72\x20\x25\x73\x2e" "\n"
600,pResLine->resParas);if(NULL==pResLine){return;}if(ZAT_CDSI_CMD!=pResLine->
601atCmdId){return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));
602if(strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")==
603(0xb88+3843-0x1a8b)){printf(
604"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x3a\x20\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67" "\n"
605);return;}memory=strstr(pResLine->resParas,"\"");if(NULL!=memory){memory++;}
606printf(
607"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x3a\x20\x6d\x65\x6d\x6f\x72\x79\x20\x3d\x20\x25\x73" "\n"
608,memory);if((0x672+5749-0x1ce7)==strncmp("\x53\x4d",memory,(0x2400+403-0x2591)))
609{zUfiSms_SetSmsLocation(SMS_LOCATION_SIM);zUfiSms_ChangeMainState(
610SMS_STATE_RECVING);memory+=(0x18d4+1384-0x1e38);printf(
611"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x6e\x64\x20\x63\x6d\x67\x72\x3a\x20\x25\x73" "\n"
612,memory);zSvr_InnerSendMsg(ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,
613MSG_CMD_AT_ZMGR,strlen(memory),memory);}else{printf(
614"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x20\x3a\x73\x74\x6f\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x6e\x6f\x74\x20\x53\x4d\x2e" "\n"
615);}sc_cfg_set(NV_SMS_RECV_RESULT,"");}int atSms_SendZmenaReq(PSTR pAtCmdPara,int
616 cid,PSTR pAtRst,int atRstSize){CHAR pAtcmdStr[(0x10fc+656-0x1378)]={
617(0xe0f+5854-0x24ed)};snprintf(pAtcmdStr,sizeof(pAtcmdStr),
618"\x41\x54\x2b\x5a\x4d\x45\x4e\x41\x3d\x25\x73" "\r\n",pAtCmdPara);return
619zSvr_SendAtSyn(ZAT_ZMENA_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID
620atSms_RecvZmenaOk(VOID){g_Zmena_rsp=TRUE;return;}VOID atSms_RecvZmenaErr(VOID){
621g_Zmena_rsp=FALSE;return;}int atSms_SendCnmaReq(PSTR pAtCmdPara,int cid,PSTR
622pAtRst,int atRstSize){int atRes=(0x68a+4025-0x1643);CHAR pAtcmdStr[ZSMS_PDU_SIZE
623]={(0x7f2+1008-0xbe2)};CHAR ackPduStr[(0x172c+1885-0x1e57)]={(0x3c3+4472-0x153b)
624};if(atoi(pAtCmdPara)==(0x6e9+7538-0x245a)){snprintf(pAtcmdStr,sizeof(pAtcmdStr)
625,"\x41\x54\x2b\x43\x4e\x4d\x41\x3d\x25\x73" "\r\n",pAtCmdPara);atRes=
626zSvr_SendAtSyn(ZAT_CNMA_CMD,pAtcmdStr,cid,pAtRst,atRstSize);printf(
627"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x20\x31\x31\x31\x31\x31\x31\x20\x61\x63\x6b\x20\x6f\x6b\x20\x3d\x20\x25\x73\x2e" "\n"
628,pAtcmdStr);return(0xd2a+4658-0x1f5c);}else{zUfiSms_EncodePdu_DeliverReport(
629ackPduStr,(0xcef+5558-0x21d2));snprintf(pAtcmdStr,sizeof(pAtcmdStr),
630"\x41\x54\x2b\x43\x4e\x4d\x41\x3d\x25\x73\x2c\x25\x64" "\r\n",pAtCmdPara,strlen(
631ackPduStr)/(0xe50+3389-0x1b8b));atRes=zSvr_SendAtSyn(ZAT_CNMA_CMD,pAtcmdStr,cid,
632pAtRst,atRstSize);if(atRes!=ZAT_RESULT_SMS){return atRes;}printf(
633"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x20\x3d\x20\x25\x73\x2e" "\n"
634,pAtcmdStr);memset(pAtcmdStr,(0x412+1275-0x90d),ZSMS_PDU_SIZE);if(strlen(
635ackPduStr)<ZSMS_PDU_SIZE-(0x353+5295-0x1801)){memcpy(pAtcmdStr,ackPduStr,strlen(
636ackPduStr));}else{printf(
637"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n"
638,ackPduStr);memcpy(pAtcmdStr,ackPduStr,ZSMS_PDU_SIZE-(0xe0b+1562-0x1423));}*(
639pAtcmdStr+strlen(ackPduStr))=ZSMS_CTRL_Z_CHAR;printf(
640"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x2e\x20\x70\x64\x75\x3d\x20\x25\x73" "\n"
641,pAtcmdStr);memset(pAtRst,(0x6aa+8231-0x26d1),atRstSize);return zSvr_SendAtSyn(
642ZAT_CNMA_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}}VOID atSms_RecvCnmaRsp(
643T_zAt_AtRes*pResLine){return;}VOID atUnsoli_Delete_Sim_Sms(UINT8*pDatabuf,int
644cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]={(0x19a7+2215-0x224e)};int atRes=
645(0x196c+196-0x1a30);if(pDatabuf==NULL){return;}atRes=atSms_SendCmgdReq(pDatabuf,
646cid,errCode,ZSVR_AT_RES_CODE_LEN);if(atRes==ZSMS_RESULT_OK){atSms_RecvCmgdOk();}
647else{atSms_RecvCmgdErr();}atSms_RecvCmgdFinish();}VOID atUnsoli_Report_Cnma(
648UINT8*pDatabuf,int cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]={(0x131c+1462-0x18d2)
649};if(pDatabuf==NULL){printf(
650"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x55\x6e\x73\x6f\x6c\x69\x5f\x52\x65\x70\x6f\x72\x74\x5f\x43\x6e\x6d\x61\x20\x6e\x75\x6c\x6c"
651);return;}atSms_SendCnmaReq(pDatabuf,cid,errCode,ZSVR_AT_RES_CODE_LEN);}VOID
652atUnsoli_Report_Zmena(UINT8*pDatabuf,int cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]
653={(0x11f7+2543-0x1be6)};int atRes=(0xb9a+4471-0x1d11);if(pDatabuf==NULL){printf(
654"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x55\x6e\x73\x6f\x6c\x69\x5f\x52\x65\x70\x6f\x72\x74\x5f\x5a\x6d\x65\x6e\x61\x20\x6e\x75\x6c\x6c"
655);return;}atRes=atSms_SendZmenaReq(pDatabuf,cid,errCode,ZSVR_AT_RES_CODE_LEN);if
656(atRes==ZSMS_RESULT_OK){atSms_RecvZmenaOk();}else{atSms_RecvZmenaErr();}}VOID
657atUnsoli_Report_Zmgr(UINT8*pDatabuf,int cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]=
658{(0x1b04+672-0x1da4)};if(pDatabuf==NULL){printf(
659"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x55\x6e\x73\x6f\x6c\x69\x5f\x52\x65\x70\x6f\x72\x74\x5f\x5a\x6d\x67\x72\x20\x6e\x75\x6c\x6c"
660);return;}atSms_SendZmgrReq(pDatabuf,cid,errCode,ZSVR_AT_RES_CODE_LEN);}
661#endif
662