xf.li | bfc6e71 | 2025-02-07 01:54:34 -0800 | [diff] [blame^] | 1 | |
| 2 | #include <errno.h>
|
| 3 | #include <sys/msg.h>
|
| 4 | #include <semaphore.h>
|
| 5 | #include <limits.h>
|
| 6 | #include <pthread.h>
|
| 7 | #include "sms_code.h"
|
| 8 | typedef VOID(*pAtWeb_SmsMsgProc)(UINT8*pDatabuf);typedef struct{UINT32 msg_id; |
| 9 | VOID(*func_ptr)(UINT8*pDatabuf);BOOL need_block;}T_zSmsHandleTable;VOID |
| 10 | atWeb_SendSms(UINT8*pDatabuf);VOID atWeb_DelSmsByIndex(UINT8*pDatabuf);VOID |
| 11 | atWeb_DelSmsByType(UINT8*pDatabuf);VOID atWeb_ReadSms(UINT8*pDatabuf);VOID |
| 12 | atWeb_SaveSms(UINT8*pDatabuf);VOID atWeb_SetSms(UINT8*pDatabuf);VOID |
| 13 | atWeb_OutdateSmsCheck(UINT8*pDatabuf);int zSms_SendZmgrReq(int index);extern |
| 14 | UINT8 g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_MAX];extern T_zSms_SendSmsReq |
| 15 | g_zUfiSms_FinalCmgsBuf;extern int g_zUfiSms_CurConcatSegNo;extern |
| 16 | T_zUfiSms_DbStoreData g_zUfiSms_DbStoreData[ZTE_WMS_CONCAT_SMS_COUNT_MAX];extern |
| 17 | int g_zUfiSms_SendFailedCount;extern int g_zUfiSms_ConcatTotalNum;extern UINT8 |
| 18 | g_zUfiSms_IsConcatSendSuc;int iSmsIndex=(0x491+3896-0x13c9);int g_zSms_MsqId=- |
| 19 | (0x24+7436-0x1d2f);int g_zSms_LocalMsqId=-(0x222+3114-0xe4b);sem_t g_sms_sem_id; |
| 20 | T_zSms_optRsp g_smsOptRsp={(0xaf9+2542-0x14e7)};static const T_zSmsHandleTable |
| 21 | SmsHandleWebTab[]={{MSG_CMD_SEND_SMS,atWeb_SendSms,TRUE},{ |
| 22 | MSG_CMD_DEL_SMS_BY_INDEX,atWeb_DelSmsByIndex,TRUE},{MSG_CMD_SMS_MODIFY_TAG, |
| 23 | atWeb_ReadSms,TRUE},{MSG_CMD_DRAFTS_SAVE,atWeb_SaveSms,FALSE},{ |
| 24 | MSG_CMD_SMS_LOCATION_SET,atWeb_SetSms,TRUE},{MSG_CMD_SMS_OUTDATE_CHECK, |
| 25 | atWeb_OutdateSmsCheck,TRUE},{(0xc1c+3312-0x190c),NULL,FALSE}};VOID atWeb_SendSms |
| 26 | (UINT8*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL;T_zUfiSms_StatusInfo tStatus={ |
| 27 | (0x38c+4353-0x148d)};assert(pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*) |
| 28 | pDatabuf;zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_MSG_SEND);(void) |
| 29 | zUfiSms_SendRawSms((T_zUfiSms_SendReq*)ptMessage->msg_data);}VOID |
| 30 | atWeb_DelSmsByIndex(UINT8*pDatabuf){T_zUfiSms_DelReq tDelReq={ |
| 31 | (0x1467+3798-0x233d)};T_zUfiSms_CmdStatus result=WMS_CMD_PROCESSING; |
| 32 | T_zUfiSms_StatusInfo tStatus={(0x5d2+3619-0x13f5)};assert(pDatabuf!=NULL);printf |
| 33 | ("[SMS] atWeb_DelSmsByIndex recv msg\n");memcpy(&tDelReq,pDatabuf,sizeof( |
| 34 | T_zUfiSms_DelReq));zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_MSG_DELETE);result |
| 35 | =zUfiSms_DeleteSms(&tDelReq);tStatus.cmd_status=result;(void) |
| 36 | zUfiSms_SetCmdStatus(&tStatus);zUfiMmi_SendSmsStatus();}VOID atWeb_DelSmsByType( |
| 37 | UINT8*pDatabuf){ |
| 38 | #if (0x344+368-0x4b4)
|
| 39 | WEB_DEL_SMS_BY_TYPE*req=NULL;req=(WEB_DEL_SMS_BY_TYPE*)pDatabuf;assert(req!=NULL |
| 40 | );if(req->eLocation!=ZSMS_LOCATION_SIM){ZTE_LOG(LOG_ERR, |
| 41 | "\x7a\x53\x6d\x73\x5f\x50\x72\x65\x70\x44\x65\x6c\x42\x79\x54\x79\x70\x65\x20\x70\x61\x72\x61\x20\x4e\x55\x4c\x4c\x2e" "\n" |
| 42 | );return;}zSms_ChangeMainState(ZSMS_STATE_DELING);ZTE_LOG(LOG_DEBUG, |
| 43 | "\x7a\x53\x6d\x73\x5f\x50\x72\x65\x70\x44\x65\x6c\x42\x79\x54\x79\x70\x65\x20\x70\x73\x74\x52\x65\x71\x2d\x3e\x65\x42\x6f\x78\x4e\x61\x6d\x65\x3d\x25\x64" "\n" |
| 44 | ,req->eBoxName);SMS_DeleteRecordFromXML(SMS_LOCATION_SIM,(0x1a7+5576-0x176f),req |
| 45 | ->eBoxName);if(req->eBoxName==SMS_INBOX){sms_LoadSmsFromSim();} |
| 46 | #endif
|
| 47 | }VOID atWeb_ReadSms(UINT8*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL; |
| 48 | T_zUfiSms_CmdStatus result=WMS_CMD_PROCESSING;T_zUfiSms_StatusInfo tStatus={ |
| 49 | (0x20b+4601-0x1404)};assert(pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*) |
| 50 | pDatabuf;zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_MSG_MODIFY_TAG);result= |
| 51 | zUfiSms_ModifySmsTag((T_zUfiSms_ModifyFlag*)ptMessage->msg_data);tStatus. |
| 52 | cmd_status=result;(void)zUfiSms_SetCmdStatus(&tStatus);}VOID atWeb_SaveSms(UINT8 |
| 53 | *pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL;T_zUfiSms_CmdStatus result= |
| 54 | WMS_CMD_PROCESSING;T_zUfiSms_StatusInfo tStatus={(0x98f+1762-0x1071)};assert( |
| 55 | pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*)pDatabuf;zUfiSms_InitCmdStatus(& |
| 56 | tStatus,WMS_SMS_CMD_MSG_WRITE);result=zUfiSms_WriteRawSms((T_zUfiSms_SaveReq*) |
| 57 | ptMessage->msg_data);if(g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_NV]){tStatus. |
| 58 | err_code=ZTE_SMS_CMS_MEM_FULL;printf( |
| 59 | "\x5b\x53\x4d\x53\x5d\x20\x61\x74\x57\x65\x62\x5f\x53\x61\x76\x65\x53\x6d\x73\x20\x6d\x65\x6d\x20\x66\x75\x6c\x6c" "\n" |
| 60 | );}tStatus.cmd_status=result;(void)zUfiSms_SetCmdStatus(&tStatus); |
| 61 | zUfiSms_ChangeMainState(SMS_STATE_SAVING);sc_cfg_set(NV_SMS_SAVE_RESULT, |
| 62 | "\x6f\x6b");}VOID atWeb_SetSms(UINT8*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL; |
| 63 | T_zUfiSms_CmdStatus result=WMS_CMD_PROCESSING;T_zUfiSms_StatusInfo tStatus={ |
| 64 | (0x16eb+1028-0x1aef)};printf( |
| 65 | "\x49\x4e\x54\x4f\x20\x61\x74\x57\x65\x62\x5f\x53\x65\x74\x53\x6d\x73\x2e" "\n") |
| 66 | ;assert(pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*)pDatabuf; |
| 67 | zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_CFG_SET_PARAMETERS);result= |
| 68 | zUfiSms_SetSmsPara((T_zUfiSms_ParaInfo*)ptMessage->msg_data);tStatus.cmd_status= |
| 69 | result;(void)zUfiSms_SetCmdStatus(&tStatus);}VOID atWeb_OutdateSmsCheck(UINT8* |
| 70 | pDatabuf){T_zUfiSms_DelReq tSmsDel={(0x7f0+7623-0x25b7)}; |
| 71 | zUfiSms_CheckDbOutdateSms(ZTE_WMS_DB_NV_TABLE,&tSmsDel);printf( |
| 72 | "\x2d\x2d\x2d\x2d\x6f\x75\x74\x20\x63\x6f\x75\x6e\x20\x6e\x76\x74\x3a\x20\x25\x64\x2d\x2d\x2d\x2d" "\n" |
| 73 | ,tSmsDel.all_or_count);if(tSmsDel.all_or_count>(0x12b+6943-0x1c4a)){ |
| 74 | atWeb_DelSmsByIndex(&tSmsDel);}memset(&tSmsDel,(0x709+941-0xab6),sizeof( |
| 75 | T_zUfiSms_DelReq));zUfiSms_CheckDbOutdateSms(ZTE_WMS_DB_SIM_TABLE,&tSmsDel); |
| 76 | printf( |
| 77 | "\x2d\x2d\x2d\x2d\x6f\x75\x74\x20\x63\x6f\x75\x6e\x74\x20\x73\x69\x6d\x3a\x20\x25\x64\x2d\x2d\x2d\x2d" "\n" |
| 78 | ,tSmsDel.all_or_count);if(tSmsDel.all_or_count>(0x4c+4306-0x111e)){ |
| 79 | atWeb_DelSmsByIndex(&tSmsDel);}}VOID zSms_HandleWebMsg(MSG_BUF*ptMsgBuf){UINT32 |
| 80 | i=(0x162d+3387-0x2368);assert(ptMsgBuf!=NULL);printf( |
| 81 | "\x73\x6d\x73\x20\x72\x65\x63\x76\x20\x6d\x73\x67\x20\x66\x72\x6f\x6d\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x3a\x25\x64" "\n" |
| 82 | ,ptMsgBuf->usMsgCmd);while((0x1f32+747-0x221d)!=SmsHandleWebTab[i].msg_id){if( |
| 83 | ptMsgBuf->usMsgCmd==SmsHandleWebTab[i].msg_id){if(SmsHandleWebTab[i].need_block |
| 84 | &&ptMsgBuf->src_id!=MODULE_ID_SMS){ipc_send_message(MODULE_ID_SMS, |
| 85 | MODULE_ID_SMS_LOCAL,ptMsgBuf->usMsgCmd,ptMsgBuf->usDataLen,(unsigned char*) |
| 86 | ptMsgBuf->aucDataBuf,(0x1a87+1294-0x1f95));}else if(NULL!=SmsHandleWebTab[i]. |
| 87 | func_ptr){SmsHandleWebTab[i].func_ptr(ptMsgBuf->aucDataBuf);}break;}i++;}}SINT32 |
| 88 | zSms_SendMsg(USHORT Msg_cmd,USHORT us_DataLen,UCHAR*pData){printf( |
| 89 | "\x73\x6d\x73\x20\x73\x65\x6e\x64\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n" |
| 90 | ,Msg_cmd);ipc_send_message(MODULE_ID_SMS,MODULE_ID_AT_CTL,Msg_cmd,us_DataLen,( |
| 91 | unsigned char*)pData,(0x1303+5102-0x26f1));return(0x1d49+1315-0x226c);}SINT32 |
| 92 | zSms_SendCmgsReq(VOID){T_zSms_SendSmsReq sendSmsInfo={(0xd73+3579-0x1b6e)}; |
| 93 | memset(&sendSmsInfo,(0x4e6+7181-0x20f3),sizeof(T_zSms_SendSmsReq));sendSmsInfo. |
| 94 | length=g_zUfiSms_FinalCmgsBuf.length;if(strlen(g_zUfiSms_FinalCmgsBuf.pdu)< |
| 95 | ZSMS_PDU_SIZE-(0x12cb+5109-0x26bf)){memcpy(sendSmsInfo.pdu, |
| 96 | g_zUfiSms_FinalCmgsBuf.pdu,strlen(g_zUfiSms_FinalCmgsBuf.pdu));}else{printf( |
| 97 | "\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" |
| 98 | ,g_zUfiSms_FinalCmgsBuf.pdu);memcpy(sendSmsInfo.pdu,g_zUfiSms_FinalCmgsBuf.pdu, |
| 99 | ZSMS_PDU_SIZE-(0x263+6187-0x1a8c));}*(sendSmsInfo.pdu+strlen( |
| 100 | g_zUfiSms_FinalCmgsBuf.pdu))=ZSMS_CTRL_Z_CHAR; |
| 101 | #if (0x13a4+3823-0x2292) |
| 102 | printf( |
| 103 | "\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x73\x65\x6e\x64\x20\x64\x61\x74\x61" "\n" |
| 104 | );printf("\n" "\x5b\x53\x4d\x53\x5d\x25\x73" "\n",sendSmsInfo.pdu); |
| 105 | #endif
|
| 106 | zSms_SendMsg(MSG_CMD_SENDSMS_REQ,sizeof(T_zSms_SendSmsReq),&sendSmsInfo); |
| 107 | sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0x58f+8057-0x2507)){return |
| 108 | ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}VOID zSms_RecvCmgsOk(VOID){ |
| 109 | printf( |
| 110 | "\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x73\x75\x63\x63\x65\x73\x73\x2e\x20" "\n" |
| 111 | );g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo> |
| 112 | ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_DbStoreData[ |
| 113 | g_zUfiSms_CurConcatSegNo-(0x199d+794-0x1cb6)].tag=WMS_TAG_TYPE_MO_SENT_V01; |
| 114 | zUfiSms_CmgsRespProc();}VOID zSms_RecvCmgsErr(VOID){printf( |
| 115 | "\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x66\x61\x69\x6c\x2e\x20" "\n"); |
| 116 | g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo> |
| 117 | ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_SendFailedCount++;printf( |
| 118 | "\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" |
| 119 | );g_zUfiSms_DbStoreData[g_zUfiSms_CurConcatSegNo-(0xb23+6995-0x2675)].tag= |
| 120 | WMS_TAG_TYPE_MO_NOT_SENT_V01;if(g_zUfiSms_ConcatTotalNum>(0xda1+4409-0x1ed9)){ |
| 121 | g_zUfiSms_IsConcatSendSuc=FALSE;}zUfiSms_CmgsRespProc();}SINT32 zSms_SendCmgdReq |
| 122 | (UINT8 index){T_zSms_DelSmsReq delSmsReq={(0x150d+548-0x1731)};delSmsReq.index= |
| 123 | index;zSms_SendMsg(MSG_CMD_DELSMS_REQ,sizeof(T_zSms_DelSmsReq),&delSmsReq); |
| 124 | sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0xb8d+6650-0x2586)){return |
| 125 | ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}VOID zSms_RecvCmgdOk(VOID){CHAR |
| 126 | strUsed[(0x1f6+4782-0x149a)]={(0x7c7+1653-0xe3c)};int used=(0x1d52+1382-0x22b8); |
| 127 | int tmp_i=(0x41c+8940-0x2708);sc_cfg_set(NV_SMS_DEL_RESULT,"\x6f\x6b");printf( |
| 128 | "\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" |
| 129 | );sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));tmp_i=atoi( |
| 130 | strUsed);if(tmp_i<(0xd2+2286-0x9c0)||tmp_i>INT_MAX-(0x58f+4477-0x170b)){at_print |
| 131 | (LOG_ERR, |
| 132 | "\x5b\x53\x4d\x53\x5d\x57\x4d\x53\x5f\x4e\x56\x43\x4f\x4e\x46\x49\x47\x5f\x53\x49\x4d\x5f\x43\x41\x52\x44\x5f\x55\x53\x45\x44\x20\x74\x6d\x70\x5f\x69\x20\x65\x72\x72\x3a\x25\x64" "\n" |
| 133 | ,tmp_i);tmp_i=(0x1e87+2085-0x26ac);}used=tmp_i-(0x1509+833-0x1849);if(used< |
| 134 | (0x815+3685-0x167a)){used=(0x76a+2959-0x12f9);}memset(&strUsed, |
| 135 | (0x28c+9143-0x2643),(0x131c+4422-0x2458));snprintf(strUsed,sizeof(strUsed), |
| 136 | "\x25\x64",used);sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed);}VOID |
| 137 | zSms_RecvCmgdErr(VOID){sc_cfg_set(NV_SMS_DEL_RESULT,"\x66\x61\x69\x6c");printf( |
| 138 | "\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" |
| 139 | );}VOID zSms_RecvCmgdFinish(VOID){char StrValue[(0x1645+741-0x1920)]={ |
| 140 | (0x120+8615-0x22c7)};CHAR strTotal[(0x362+1659-0x9d3)]={(0x6c6+2727-0x116d)}; |
| 141 | CHAR strUsed[(0x147a+1195-0x191b)]={(0xc7+4977-0x1438)};int total= |
| 142 | (0x11c8+5139-0x25db);int used=(0x310+4312-0x13e8);int remain=(0x332+1387-0x89d); |
| 143 | sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));used=atoi( |
| 144 | strUsed);if(used<(0xb24+881-0xe95)||used>INT_MAX-(0x7a8+958-0xb65)){at_print( |
| 145 | LOG_ERR, |
| 146 | "\x5b\x53\x4d\x53\x5d\x57\x4d\x53\x5f\x4e\x56\x43\x4f\x4e\x46\x49\x47\x5f\x53\x49\x4d\x5f\x43\x41\x52\x44\x5f\x55\x53\x45\x44\x20\x65\x72\x72\x3a\x25\x64" "\n" |
| 147 | ,used);used=(0x18d4+2299-0x21cf);}sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_TOTAL, |
| 148 | strTotal,sizeof(strTotal));total=atoi(strTotal);if(total<(0xd04+5453-0x2251)|| |
| 149 | total>INT_MAX-(0x41d+6249-0x1c85)){at_print(LOG_ERR, |
| 150 | "\x5b\x53\x4d\x53\x5d\x57\x4d\x53\x5f\x4e\x56\x43\x4f\x4e\x46\x49\x47\x5f\x53\x49\x4d\x5f\x43\x41\x52\x44\x5f\x54\x4f\x54\x41\x4c\x20\x65\x72\x72\x3a\x25\x64" "\n" |
| 151 | ,total);total=(0x848+4425-0x1991);}remain=total-used;if(remain< |
| 152 | (0x11cf+4952-0x2527)){remain=(0x765+669-0xa02);}memset(&StrValue, |
| 153 | (0x2307+585-0x2550),(0x1bf7+666-0x1e87));snprintf(StrValue,sizeof(StrValue), |
| 154 | "\x25\x64",remain);sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CARD_REMAIN,StrValue);printf( |
| 155 | "\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" |
| 156 | ,used,remain,total);zUfiSms_ChangeMainState(SMS_STATE_DELED);sc_cfg_set( |
| 157 | NV_SMS_DB_CHANGE,"\x31");}int zSms_SendZmenaReq(SINT32 avail){T_zSms_StroageReq |
| 158 | storageReq={(0xddb+1645-0x1448)};storageReq.type=avail;zSms_SendMsg( |
| 159 | MSG_CMD_STORAGE_CAP_REQ,sizeof(T_zSms_StroageReq),&storageReq);sem_wait(& |
| 160 | g_sms_sem_id);if(g_smsOptRsp.result==(0xe8c+3887-0x1dba)){return ZSMS_RESULT_OK; |
| 161 | }else{return ZSMS_RESULT_ERROR;}}int zSms_SendCmgrReq(UINT8 index){ |
| 162 | T_zSms_ModifyTagReq modTagReq={(0x1290+3141-0x1ed5)};modTagReq.index=index; |
| 163 | zSms_SendMsg(MSG_CMD_MODIFY_TAG_REQ,sizeof(T_zSms_ModifyTagReq),&modTagReq); |
| 164 | sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0x6c5+6712-0x20fc)){return |
| 165 | ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}int zSms_SetCscaReq(PSTR sca){ |
| 166 | T_zSms_SetScaReq setscareq;strncpy(setscareq.sca,sca,sizeof(setscareq.sca)- |
| 167 | (0x323+2292-0xc16));zSms_SendMsg(MSG_CMD_SCA_SET_REQ,sizeof(T_zSms_SetScaReq),& |
| 168 | setscareq);sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0xd3d+5876-0x2430)){ |
| 169 | return ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}int zSms_SendCnmiReq(PSTR |
| 170 | pAtCmdPara){T_zSms_NotifySetReq notifySetReq={(0x2145+404-0x22d9)};if( |
| 171 | (0x13fd+1059-0x1820)==strcmp(pAtCmdPara,"\x73\x69\x6d")){notifySetReq.mt= |
| 172 | (0x23a2+328-0x24e9);}else{notifySetReq.mt=(0x17d6+3494-0x257a);}zSms_SendMsg( |
| 173 | MSG_CMD_NOTIFY_SET_REQ,sizeof(T_zSms_NotifySetReq),¬ifySetReq);sem_wait(& |
| 174 | g_sms_sem_id);if(g_smsOptRsp.result==(0x1b5+8977-0x24c5)){return ZSMS_RESULT_OK; |
| 175 | }else{return ZSMS_RESULT_ERROR;}}VOID zSms_RecvCmtInd(UINT8*pDatabuf){CHAR |
| 176 | needSMS[(0x908+1777-0xfc7)]={(0x10f0+4378-0x220a)};sc_cfg_get( |
| 177 | NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x8fb+3132-0x1537)==strcmp( |
| 178 | needSMS,"\x6e\x6f")){printf( |
| 179 | "\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" |
| 180 | );return;}T_zSms_SmsInd tCmtRsp={(0x358+8885-0x260d)};memcpy(&tCmtRsp,( |
| 181 | T_zSms_SmsInd*)pDatabuf,sizeof(T_zSms_SmsInd));zUfiSms_CmtRespProc(&tCmtRsp); |
| 182 | zUfiMmi_SendSmsStatus();sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}VOID |
| 183 | zSms_RecvCmtiInd(UINT8*pDatabuf){char sms_Main_state[(0x2dc+7721-0x20e7)]={ |
| 184 | (0xe84+5410-0x23a6)};T_zSms_SmsIndexInd*smsIdxInd=(T_zSms_SmsIndexInd*)pDatabuf; |
| 185 | CHAR needSMS[(0xd7a+4550-0x1f0e)]={(0xa76+7146-0x2660)};sc_cfg_get( |
| 186 | NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x867+2088-0x108f)==strcmp( |
| 187 | needSMS,"\x6e\x6f")){printf( |
| 188 | "\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" |
| 189 | );return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));if( |
| 190 | strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")== |
| 191 | (0x18b7+1300-0x1dcb)){printf( |
| 192 | "\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" |
| 193 | );return;}if((0xe4c+637-0x10c9)==strncmp("\x53\x4d",smsIdxInd->storetype, |
| 194 | (0xe8b+2252-0x1755))){zUfiSms_SetSmsLocation(SMS_LOCATION_SIM); |
| 195 | zUfiSms_ChangeMainState(SMS_STATE_RECVING);zSms_SendZmgrReq(smsIdxInd->index);} |
| 196 | else{printf( |
| 197 | "\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" |
| 198 | );}sc_cfg_set(NV_SMS_RECV_RESULT,"");}VOID zSms_RecvCdsInd(UINT8*pDatabuf){CHAR |
| 199 | needSMS[(0x9bf+2246-0x1253)]={(0x2285+389-0x240a)};sc_cfg_get( |
| 200 | NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x19f0+2873-0x2529)==strcmp( |
| 201 | needSMS,"\x6e\x6f")){printf( |
| 202 | "\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" |
| 203 | );return;}T_zSms_SmsInd tCmtRsp={(0x80b+2814-0x1309)};memcpy(&tCmtRsp,( |
| 204 | T_zSms_SmsInd*)pDatabuf,sizeof(T_zSms_SmsInd));zUfiSms_CdsRespProc(&tCmtRsp); |
| 205 | zUfiMmi_SendSmsStatus();sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}VOID |
| 206 | zSms_RecvCdsiInd(UINT8*pDatabuf){char sms_Main_state[(0x1c9d+521-0x1e88)]={ |
| 207 | (0xbba+2772-0x168e)};T_zSms_SmsIndexInd*smsIdxInd=(T_zSms_SmsIndexInd*)pDatabuf; |
| 208 | CHAR needSMS[(0xab+3971-0xffc)]={(0x5ca+286-0x6e8)};sc_cfg_get( |
| 209 | NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0xdf4+4121-0x1e0d)==strcmp( |
| 210 | needSMS,"\x6e\x6f")){printf( |
| 211 | "\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" |
| 212 | );return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));if( |
| 213 | strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")== |
| 214 | (0x983+3381-0x16b8)){printf( |
| 215 | "\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" |
| 216 | );return;}if((0x1d39+1720-0x23f1)==strncmp("\x53\x4d",smsIdxInd->storetype, |
| 217 | (0x1cf+301-0x2fa))){zUfiSms_SetSmsLocation(SMS_LOCATION_SIM); |
| 218 | zUfiSms_ChangeMainState(SMS_STATE_RECVING);zSms_SendZmgrReq(smsIdxInd->index);} |
| 219 | else{printf( |
| 220 | "\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" |
| 221 | );}sc_cfg_set(NV_SMS_RECV_RESULT,"");}int zSms_SendCnmaReq(int ack_mode){ |
| 222 | T_zSms_SmsAckReq ackReq={(0x1094+1044-0x14a8)};CHAR ackPduStr[ |
| 223 | (0x1a11+1201-0x1e90)]={(0x162b+3850-0x2535)};ackReq.ackmode=ack_mode;if(ack_mode |
| 224 | ==(0x9fa+5551-0x1fa7)){zUfiSms_EncodePdu_DeliverReport(ackPduStr, |
| 225 | (0x143f+3491-0x210f));memcpy(ackReq.pdu,ackPduStr,strlen(ackPduStr)); |
| 226 | #if (0x63f+934-0x9e5)
|
| 227 | if(strlen(ackPduStr)<ZSMS_PDU_SIZE-(0x8d4+2780-0x13af)){memcpy(ackReq.pdu, |
| 228 | ackPduStr,strlen(ackPduStr));}else{at_print(LOG_DEBUG |
| 229 | "\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n" |
| 230 | ,ackPduStr);memcpy(ackReq.pdu,ackPduStr,ZSMS_PDU_SIZE-(0x1102+4875-0x240b));} |
| 231 | #endif
|
| 232 | *(ackReq.pdu+strlen(ackPduStr))=ZSMS_CTRL_Z_CHAR;printf( |
| 233 | "\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" |
| 234 | ,ackReq.pdu);ackReq.length=strlen(ackPduStr)/(0xae5+3505-0x1894);}zSms_SendMsg( |
| 235 | MSG_CMD_SMSACK_REQ,sizeof(T_zSms_SmsAckReq),&ackReq);sem_wait(&g_sms_sem_id);if( |
| 236 | g_smsOptRsp.result==(0x525+2491-0xedf)){return ZSMS_RESULT_OK;}else{return |
| 237 | ZSMS_RESULT_ERROR;}}int zSms_SendZmgrReq(int index){T_zSms_ReadSmsReq readSmsReq |
| 238 | ={(0x142d+4208-0x249d)};iSmsIndex=index;printf( |
| 239 | "\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" |
| 240 | ,iSmsIndex);readSmsReq.index=index;zSms_SendMsg(MSG_CMD_READSMS_REQ,sizeof( |
| 241 | T_zSms_ReadSmsReq),&readSmsReq);return(0x13c+5559-0x16f3);}VOID zSms_RecvZmgrRsp |
| 242 | (UINT8*pDatabuf){T_zSms_SmsInd tCmgrRsp={(0x13af+2920-0x1f17)};memcpy(&tCmgrRsp, |
| 243 | (T_zSms_SmsInd*)pDatabuf,sizeof(T_zSms_SmsInd));tCmgrRsp.index=iSmsIndex; |
| 244 | zUfiSms_ZmgrRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();}VOID zSms_RecvZmgrOk( |
| 245 | UINT8*pDatabuf){T_zSms_optRsp smsOptRsp={(0x1d65+454-0x1f2b)};memcpy(&smsOptRsp, |
| 246 | (T_zSms_optRsp*)pDatabuf,sizeof(T_zSms_optRsp));if(smsOptRsp.result== |
| 247 | (0xb9c+875-0xf06)){sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}else{printf( |
| 248 | "\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" |
| 249 | );sc_cfg_set(NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState( |
| 250 | SMS_STATE_RECVED);}}VOID zSms_RecvZpbicInd(UINT8*pDatabuf){T_zAt_ZpbicRes*ptPara |
| 251 | =ZUFI_NULL;if(pDatabuf==NULL){return;}ptPara=(T_zAt_ZpbicRes*)(pDatabuf);if(( |
| 252 | (0x7c3+7342-0x2470)==ptPara->result)&&((0x96a+5767-0x1ff1)==ptPara->opertype)){ |
| 253 | CHAR needSms[(0x11a4+4522-0x231c)]={(0x1dd+7039-0x1d5c)};sc_cfg_get( |
| 254 | NV_NEED_SUPPORT_SMS,needSms,sizeof(needSms));if((0x553+860-0x8af)!=strcmp( |
| 255 | needSms,"\x6e\x6f")){zSvr_Zpbic_Sms_Init();}}}VOID zSms_RecvCpmsInd(UINT8* |
| 256 | pDatabuf){T_zSms_CpmsInd*cpmsInd=(T_zSms_CpmsInd*)pDatabuf;CHAR strBuf[ |
| 257 | (0x34f+7123-0x1f18)]={(0xdba+6094-0x2588)};int remainSpace=(0x70f+6278-0x1f95); |
| 258 | snprintf(strBuf,sizeof(strBuf),"\x25\x64",cpmsInd->total);sc_cfg_set( |
| 259 | ZTE_WMS_NVCONFIG_SIM_CARD_TOTAL,strBuf);sc_cfg_set( |
| 260 | ZTE_WMS_NVCONFIG_SIM_CAPABILITY,strBuf);memset(&strBuf,(0x1a1+1197-0x64e), |
| 261 | (0x5cc+6259-0x1e35));snprintf(strBuf,sizeof(strBuf),"\x25\x64",cpmsInd->used); |
| 262 | sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strBuf);remainSpace=cpmsInd->total- |
| 263 | cpmsInd->used;memset(&strBuf,(0xaef+5647-0x20fe),(0x659+776-0x957));snprintf( |
| 264 | strBuf,sizeof(strBuf),"\x25\x64",remainSpace);sc_cfg_set( |
| 265 | ZTE_WMS_NVCONFIG_SIM_CARD_REMAIN,strBuf);sc_cfg_set(NV_SMS_STORE,"\x6f\x6b");} |
| 266 | #define AT_CMD_MAX (0xfab+1648-0x15db)
|
| 267 | #define ZAT_TAB_REPLACE ((unsigned char )(\ |
| 268 | (0x1c9c+2460-0x253c)))
|
| 269 | #define ZAT_NULL_FILL ((unsigned char )((0x122+2248-0x8ed)\ |
| 270 | ))
|
| 271 | #define ZAT_SPACE_REPLACE ((unsigned char )(\ |
| 272 | (0x1731+2168-0x1eab)))
|
| 273 | #define ZAT_LF_REPLACE ((unsigned char )(\ |
| 274 | (0x62a+4773-0x17d4)))
|
| 275 | #define ZAT_CR_REPLACE ((unsigned char )(\ |
| 276 | (0x553+8614-0x25ff)))
|
| 277 | static void atBase_PreProcRes(char*pParaLine,int paraSize){signed long flg= |
| 278 | (0xe43+5379-0x2346);unsigned long i=(0x622+4342-0x1718);unsigned long length= |
| 279 | (0x1157+3151-0x1da6);char*pSource=pParaLine;char*pDest=NULL;char*pStrDestMalloc= |
| 280 | (char*)malloc(AT_CMD_MAX);if(NULL==pStrDestMalloc){return;}memset(pStrDestMalloc |
| 281 | ,(0x892+6111-0x2071),AT_CMD_MAX);assert(pParaLine!=NULL);pDest=pStrDestMalloc; |
| 282 | length=strlen(pParaLine);if((length==(0xb37+871-0xe9e))||(length>=AT_CMD_MAX)){ |
| 283 | free(pStrDestMalloc);return;}for(i=(0x9d5+7250-0x2627);(i<length)&&(pDest- |
| 284 | pStrDestMalloc<AT_CMD_MAX);i++){if(((char)(0x110b+2214-0x198f))==*pSource){flg=( |
| 285 | (0x16dd+1489-0x1cae)==flg)?(0x287+3229-0xf23):(0x1392+528-0x15a2);if( |
| 286 | ((char)(0xdd3+3510-0x1b67))==*(pSource+(0x1225+942-0x15d2))){*pDest++=(char) |
| 287 | ZAT_NULL_FILL;}}else if((((char)(0x851+1619-0xe78))==*pSource)&&( |
| 288 | (0x1758+1232-0x1c28)==flg)){*pDest++=((char)(0xe7b+379-0xfd6));if( |
| 289 | ((char)(0x12ad+5113-0x267a))==*(pSource+(0xdd1+2970-0x196a))){*pDest++= |
| 290 | ((char)(0x3e2+3098-0xfc3));}else if('\0'==*(pSource+(0x1a69+519-0x1c6f))){*pDest |
| 291 | ++=(char)ZAT_NULL_FILL;}}else{if((((char)(0x1b94+2916-0x26d8))==*pSource)&&( |
| 292 | (0x5c6+1446-0xb6b)==flg)){*pDest++=(char)ZAT_SPACE_REPLACE;}else if(('\t'==* |
| 293 | pSource)&&((0x55a+8478-0x2677)==flg)){*pDest++=(char)ZAT_TAB_REPLACE;}else if(( |
| 294 | '\n'==*pSource)&&((0x245+4523-0x13ef)==flg)){*pDest++=(char)ZAT_LF_REPLACE;}else |
| 295 | if(('\r'==*pSource)&&((0x75b+3123-0x138d)==flg)){*pDest++=(char)ZAT_CR_REPLACE; |
| 296 | }else{*pDest++=*pSource;}}pSource++;}memset(pParaLine,(0x383+404-0x517),paraSize |
| 297 | );strncpy(pParaLine,pStrDestMalloc,paraSize-(0x4f1+6200-0x1d28));free( |
| 298 | pStrDestMalloc);}VOID zSms_RecvCscaInd(UINT8*pDatabuf){T_zSms_CscaInd cscaInd={ |
| 299 | (0x385+1585-0x9b6)}; |
| 300 | #if (0xb62+5910-0x2277) |
| 301 | printf( |
| 302 | "\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x7a\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x73\x63\x61\x49\x6e\x64\x20\x64\x61\x74\x61\x62\x75\x66\x3a\x25\x73" "\n" |
| 303 | ,pDatabuf); |
| 304 | #endif
|
| 305 | atBase_PreProcRes(pDatabuf,strlen(pDatabuf));sscanf(pDatabuf, |
| 306 | "\x25\x32\x31\x73\x20\x25\x32\x31\x73",cscaInd.sca,cscaInd.tosca); |
| 307 | #if (0x121+6723-0x1b63) |
| 308 | printf( |
| 309 | "\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x7a\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x73\x63\x61\x49\x6e\x64\x20\x73\x63\x61\x3a\x25\x73\x2c\x20\x74\x6f\x73\x63\x61\x25\x73" "\n" |
| 310 | ,cscaInd.sca,cscaInd.tosca); |
| 311 | #endif
|
| 312 | sc_cfg_set(NV_SMS_CENTER_NUM,cscaInd.sca);zUfiSms_SetScaPara(cscaInd.sca);}VOID |
| 313 | zSms_RecvZmglInd(UINT8*pDatabuf){zUfiSms_CmglRespProc((T_zSms_SmsInd*)pDatabuf); |
| 314 | }int zSms_SendSmsInitReq(VOID){zSms_SendMsg(MSG_CMD_SMSINIT_REQ, |
| 315 | (0x1748+156-0x17e4),NULL);return(0x626+1706-0xcd0);}VOID zSms_initAtOk(VOID){ |
| 316 | T_zUfiSms_StatusInfo tStatus={(0x10b+411-0x2a6)};sc_cfg_set(NV_SMS_STORE, |
| 317 | "\x6f\x6b");sc_cfg_set(NV_SMS_LOAD_RESULT,"\x6f\x6b");tStatus.cmd_status= |
| 318 | WMS_CMD_SUCCESS;tStatus.cmd=WMS_SMS_CMD_INIT;(void)zUfiSms_SetCmdStatus(&tStatus |
| 319 | );zUfiSms_ChangeMainState(SMS_STATE_LOADED);}VOID zSms_initAtErr(VOID){ |
| 320 | T_zUfiSms_StatusInfo tStatus={(0x584+6585-0x1f3d)};sc_cfg_set(NV_SMS_LOAD_RESULT |
| 321 | ,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_LOADED);tStatus. |
| 322 | cmd_status=WMS_CMD_FAILED;tStatus.cmd=WMS_SMS_CMD_INIT;(void) |
| 323 | zUfiSms_SetCmdStatus(&tStatus);}VOID zSms_RecvSmsInitRst(UINT8*pDatabuf){memcpy( |
| 324 | &g_smsOptRsp,pDatabuf,sizeof(T_zSms_optRsp));if(g_smsOptRsp.result== |
| 325 | (0x1bc5+748-0x1eb0)){zSms_initAtOk();}else{zSms_initAtErr();}}UINT8 |
| 326 | zSms_SmsMsgCreat(VOID){g_zSms_MsqId=msgget(MODULE_ID_SMS,IPC_CREAT| |
| 327 | (0xc74+1274-0xfee));if(g_zSms_MsqId==-(0xc6b+3916-0x1bb6)){return ZUFI_FAIL;} |
| 328 | g_zSms_LocalMsqId=msgget(MODULE_ID_SMS_LOCAL,IPC_CREAT|(0x7fc+5701-0x1cc1));if( |
| 329 | g_zSms_LocalMsqId==-(0x1c9b+65-0x1cdb)){return ZUFI_FAIL;}sem_init(&g_sms_sem_id |
| 330 | ,(0x1922+1102-0x1d70),(0x1af6+2504-0x24be));return ZUFI_SUCC;}void |
| 331 | zSms_HandleAtctlLocalMsg(MSG_BUF*ptMsgBuf){assert(ptMsgBuf!=NULL);printf( |
| 332 | "\x73\x6d\x73\x20\x6c\x6f\x63\x61\x6c\x20\x72\x65\x63\x76\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n" |
| 333 | ,ptMsgBuf->usMsgCmd);switch(ptMsgBuf->usMsgCmd){case MSG_CMD_ZPBIC_IND: |
| 334 | zSms_RecvZpbicInd(ptMsgBuf->aucDataBuf);break;case MSG_CMD_ZMGL_IND: |
| 335 | zSms_RecvZmglInd(ptMsgBuf->aucDataBuf);break;case MSG_CMD_NEWSMS_STATUS_IND: |
| 336 | zSms_RecvCdsInd(ptMsgBuf->aucDataBuf);break;case MSG_CMD_NEWSMS_IND: |
| 337 | zSms_RecvCmtInd(ptMsgBuf->aucDataBuf);default:break;}}VOID zSms_HandleAtctlMsg( |
| 338 | MSG_BUF*ptMsgBuf){assert(ptMsgBuf!=NULL);printf( |
| 339 | "\x73\x6d\x73\x20\x72\x65\x63\x76\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n" |
| 340 | ,ptMsgBuf->usMsgCmd);switch(ptMsgBuf->usMsgCmd){case MSG_CMD_SENDSMS_RSP:case |
| 341 | MSG_CMD_DELSMS_RSP:case MSG_CMD_STORAGE_CAP_RSP:case MSG_CMD_MODIFY_TAG_RSP:case |
| 342 | MSG_CMD_NOTIFY_SET_RSP:case MSG_CMD_SCA_SET_RSP:case MSG_CMD_SMSACK_RSP:{memcpy |
| 343 | (&g_smsOptRsp,ptMsgBuf->aucDataBuf,sizeof(T_zSms_optRsp));sem_post(&g_sms_sem_id |
| 344 | );}break;case MSG_CMD_CPMS_IND:zSms_RecvCpmsInd(ptMsgBuf->aucDataBuf);break;case |
| 345 | MSG_CMD_CSCA_IND:zSms_RecvCscaInd(ptMsgBuf->aucDataBuf);break;case |
| 346 | MSG_CMD_ZMGR_IND:zSms_RecvZmgrRsp(ptMsgBuf->aucDataBuf);break;case |
| 347 | MSG_CMD_READSMS_RSP:zSms_RecvZmgrOk(ptMsgBuf->aucDataBuf);break;case |
| 348 | MSG_CMD_SMSINIT_RSP:zSms_RecvSmsInitRst(ptMsgBuf->aucDataBuf);break;case |
| 349 | MSG_CMD_NEWSMS_INDEX_IND:zSms_RecvCmtiInd(ptMsgBuf->aucDataBuf);break;case |
| 350 | MSG_CMD_NEWSMS_STATUS_INDEX_IND:zSms_RecvCdsiInd(ptMsgBuf->aucDataBuf);break; |
| 351 | case MSG_CMD_NEWSMS_IND:case MSG_CMD_ZPBIC_IND:case MSG_CMD_ZMGL_IND:case |
| 352 | MSG_CMD_NEWSMS_STATUS_IND:ipc_send_message(MODULE_ID_SMS,MODULE_ID_SMS_LOCAL, |
| 353 | ptMsgBuf->usMsgCmd,ptMsgBuf->usDataLen,(unsigned char*)ptMsgBuf->aucDataBuf, |
| 354 | (0x25a+7929-0x2153));break;default:break;}}VOID zSms_HandleResetToFactory(){CHAR |
| 355 | clearSms[(0x1871+2544-0x222f)]={(0x759+1666-0xddb)};sc_cfg_get( |
| 356 | NV_CLEAR_SMS_WHEN_RESTORE,clearSms,sizeof(clearSms));printf( |
| 357 | "\x61\x74\x57\x65\x62\x5f\x52\x65\x73\x74\x6f\x72\x65\x46\x61\x63\x74\x6f\x72\x79\x53\x65\x74\x74\x69\x6e\x67\x20\x65\x6e\x74\x65\x72\x65\x64\x21\x20" "\n" |
| 358 | );printf( |
| 359 | "\x63\x6c\x65\x61\x72\x5f\x73\x6d\x73\x5f\x77\x68\x65\x6e\x5f\x72\x65\x73\x74\x6f\x72\x65\x3d\x25\x73\x20" "\n" |
| 360 | ,clearSms);if(strcmp(clearSms,"\x79\x65\x73")==(0x327+5545-0x18d0)){printf( |
| 361 | "\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x72\x6f\x70\x41\x6c\x6c\x54\x61\x62\x6c\x65\x20\x65\x6e\x74\x65\x72\x65\x64\x21\x20" "\n" |
| 362 | );zUfiSms_DropAllTable();}else{printf( |
| 363 | "\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x72\x6f\x70\x41\x6c\x6c\x54\x61\x62\x6c\x65\x45\x78\x63\x65\x70\x74\x53\x6d\x73\x20\x65\x6e\x74\x65\x72\x65\x64\x21\x20" "\n" |
| 364 | );zUfiSms_DropAllTableExceptSms();}ipc_send_message(MODULE_ID_SMS, |
| 365 | MODULE_ID_MAIN_CTRL,MSG_CMD_RESET_RSP,(0x1461+3029-0x2036),NULL, |
| 366 | (0x163+6829-0x1c10));}void zSms_HandleMainCtrlMsg(MSG_BUF*ptMsgBuf){assert( |
| 367 | ptMsgBuf!=NULL);printf( |
| 368 | "\x73\x6d\x73\x20\x72\x65\x63\x76\x20\x6d\x61\x69\x6e\x20\x63\x74\x72\x6c\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n" |
| 369 | ,ptMsgBuf->usMsgCmd);switch(ptMsgBuf->usMsgCmd){case MSG_CMD_RESET_NOTIFY: |
| 370 | zSms_HandleResetToFactory(ptMsgBuf->aucDataBuf);break;default:break;}}void |
| 371 | sms_msg_thread_proc(void*arg){int iRet=(0xb60+1700-0x1204);MSG_BUF stMsg={ |
| 372 | (0x3d4+8753-0x2605)};int msgSize=sizeof(MSG_BUF)-sizeof(long);int queueId=*((int |
| 373 | *)arg);prctl(PR_SET_NAME,"\x73\x6d\x73\x5f\x6c\x6f\x63\x61\x6c", |
| 374 | (0x12c9+582-0x150f),(0x91b+1988-0x10df),(0xf74+4524-0x2120));while( |
| 375 | (0xb22+3411-0x1874)){iRet=(0x59b+2292-0xe8f);memset(&stMsg,(0x529+2870-0x105f), |
| 376 | sizeof(MSG_BUF));iRet=msgrcv(queueId,&stMsg,msgSize,(0xe87+2449-0x1818), |
| 377 | (0x19f0+3295-0x26cf));if(iRet>=(0x22a1+326-0x23e7)){switch(stMsg.src_id){case |
| 378 | MODULE_ID_WEB_CGI:{zSms_HandleWebMsg(&stMsg);break;}case MODULE_ID_AT_CTL:{ |
| 379 | zSms_HandleAtctlMsg(&stMsg);break;}case MODULE_ID_SMS:{zSms_HandleWebMsg(&stMsg) |
| 380 | ;zSms_HandleAtctlLocalMsg(&stMsg);break;}case MODULE_ID_MAIN_CTRL:{ |
| 381 | zSms_HandleMainCtrlMsg(&stMsg);break;}default:{break;}}}else{at_print(AT_DEBUG, |
| 382 | "\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x2c\x20\x65\x72\x72\x6d\x73\x67\x20\x3d\x20\x25\x73" "\n" |
| 383 | ,errno,strerror(errno));}}}int sms_main(int argc,char*argv[]){pthread_t |
| 384 | recv_thread_tid=(0x546+178-0x5f8);MSG_BUF msgBuf={(0x85a+5342-0x1d38)};CHAR |
| 385 | needSMS[(0x16ea+2122-0x1f02)]={(0xea3+1178-0x133d)};prctl(PR_SET_NAME, |
| 386 | "\x73\x6d\x73\x5f\x6d\x61\x69\x6e",(0x14fd+359-0x1664),(0xcb6+5473-0x2217), |
| 387 | (0x322+7676-0x211e));loglevel_init();sc_cfg_get(NV_NEED_SUPPORT_SMS,needSMS, |
| 388 | sizeof(needSMS));if((0x453+7708-0x226f)!=strcmp(needSMS,"\x6e\x6f")){ |
| 389 | zUfiSms_InitDb();zUfiSms_CfgSmsNvInit();zUfiMmi_SendSmsStatus();zSms_SmsMsgCreat |
| 390 | ();}else{return-(0x189f+1040-0x1cae);}printf( |
| 391 | "\x73\x6d\x73\x20\x61\x70\x70\x20\x69\x6e\x69\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64\x2c\x20\x77\x69\x6c\x6c\x20\x74\x6f\x20\x72\x65\x63\x65\x69\x76\x65\x20\x6d\x73\x67\x2c\x20\x6d\x73\x67\x69\x64\x3a\x25\x64" "\n" |
| 392 | ,g_zSms_MsqId);if(pthread_create(&recv_thread_tid,NULL,sms_msg_thread_proc,(void |
| 393 | *)(&g_zSms_LocalMsqId))==-(0x4f5+7384-0x21cc)){assert((0x270+7721-0x2099));} |
| 394 | sms_msg_thread_proc(&g_zSms_MsqId);return(0x8bc+7114-0x2486);} |