lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @file sms_msg.h |
| 3 | * @brief ¶ÌÏûÏ¢Ó¦ÓöÔÍâÌṩµÄÏûÏ¢¼°½á¹¹Ì壬Ö÷ҪʹÓÃÕß°üÀ¨webserver¼°tro69»òÆäËûÓ¦Óà |
| 4 | * |
| 5 | * Copyright (C) 2017 Sanechips Technology Co., Ltd. |
| 6 | * @author |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | */ |
| 13 | #ifndef __SMS_MSG_H__ |
| 14 | #define __SMS_MSG_H__ |
| 15 | |
| 16 | #include "message.h" |
| 17 | |
| 18 | enum sms_msg_cmd { |
| 19 | MSG_CMD_COPY_SMS = MSG_CMD_SMS_BASE,//0x4100 /*Ò³Ãæ·¢Ë͸´ÖƶÌÐÅÇëÇó*/ |
| 20 | MSG_CMD_SEND_SMS,//¶ÔÓ¦½á¹¹ÌåT_zGoaheadMsgBuf |
| 21 | MSG_CMD_DEL_SMS_BY_INDEX,//¶ÔÓ¦½á¹¹ÌåT_zUfiSms_DelReq |
| 22 | MSG_CMD_DEL_SMS_BY_TYPE, |
| 23 | MSG_CMD_SMS_MODIFY_TAG,//¶ÔÓ¦½á¹¹ÌåT_zGoaheadMsgBuf |
| 24 | MSG_CMD_DRAFTS_SAVE,//¶ÔÓ¦½á¹¹ÌåT_zGoaheadMsgBuf |
| 25 | MSG_CMD_SMS_LOCATION_SET,//¶ÔÓ¦½á¹¹ÌåT_zGoaheadMsgBuf |
| 26 | MSG_CMD_SMS_OUTDATE_CHECK,//ÎÞ²ÎÊý |
| 27 | /***----MSG_CMD_SMS_END 0x4180 ºÏ¼Æ128¸ö-------*/ |
| 28 | }; |
| 29 | |
| 30 | /************¶ÌÏûÏ¢Ïà¹ØÏûÏ¢¶ÔÓ¦µÄ½á¹¹Ìåbegin***********/ |
| 31 | #define ZTE_MODEM_RELAY_MSGBUF_MAX_LEN 600 |
| 32 | #ifdef CONFIG_MIN_8M_VERSION |
| 33 | #define ZTE_WMS_DELETE_COUNT_MAX 20 |
| 34 | #else |
| 35 | #define ZTE_WMS_DELETE_COUNT_MAX 100 |
| 36 | #endif |
| 37 | |
| 38 | typedef enum { |
| 39 | ZTE_MC_STATE_TYPE, //machine state maintain type |
| 40 | ZTE_MDM_REALY_TYPE, //mdm mode relay type |
| 41 | ZTE_WAN_RELAY_TYPE, //wan mode relay type |
| 42 | ZTE_LAN_RELAY_TYPE, //lan mode relay type |
| 43 | ZTE_SMS_RELAY_TYPE, //shortmsg mode relay type |
| 44 | ZTE_PBM_RELAY_TYPE, //phonebook mode relay type |
| 45 | ZTE_ATSERVER_RELAY_TYPE, //at server mode relay type |
| 46 | ZTE_SLEEP_WAKEUP_RELAY_TYPE, // relay sleep and wakeup type |
| 47 | ZTE_FOTA_RELAY_TYPE, //fota modle relay type |
| 48 | ZTE_USSD_RELAY_TYPE, // relay USSDtype |
| 49 | ZTE_AP_STATION_RELAY_TYPE, // relay USSDtype |
| 50 | ZTE_BUZZER_RELAY_TYPE, // |
| 51 | ZTE_MODE_RELAY_TYPE, // |
| 52 | ZTE_KEY_RELAY_TYPE // |
| 53 | } zte_mc_msg_mode_e_type; |
| 54 | |
| 55 | typedef struct { |
| 56 | zte_mc_msg_mode_e_type type; |
| 57 | unsigned long id; |
| 58 | int result; |
| 59 | } zte_mc_msg_hdr_s_type; |
| 60 | |
| 61 | //MSG_CMD_SEND_SMS/MSG_CMD_SMS_MODIFY_TAG/MSG_CMD_DRAFTS_SAVEÏûÏ¢·¢ËÍʹÓøòÎÊý |
| 62 | typedef struct { |
| 63 | zte_mc_msg_hdr_s_type msg_hdr; //the message header |
| 64 | unsigned long msg_len; //the message len |
| 65 | unsigned char msg_data[ZTE_MODEM_RELAY_MSGBUF_MAX_LEN]; //the message data |
| 66 | } T_zGoaheadMsgBuf; |
| 67 | |
| 68 | |
| 69 | //MSG_CMD_DEL_SMS_BY_INDEXÏûÏ¢·¢ËÍʹÓøòÎÊý |
| 70 | typedef struct { |
| 71 | unsigned char all_or_count; /*all_or_count=0--->delete all,others--->delete partial sms*/ |
| 72 | int id[ZTE_WMS_DELETE_COUNT_MAX]; |
| 73 | unsigned char sql[2]; |
| 74 | } T_zUfiSms_DelReq; |
| 75 | |
| 76 | /************¶ÌÏûÏ¢Ïà¹ØÏûÏ¢¶ÔÓ¦µÄ½á¹¹Ìåend***********/ |
| 77 | |
| 78 | |
| 79 | //Ô´×Ôsms_com.h£¬¹©webserverʹÓà |
| 80 | |
| 81 | /************************************************************************** |
| 82 | * ³£Á¿¶¨ÒåÇø |
| 83 | **************************************************************************/ |
| 84 | #define ZTE_WMS_MESSAGE_LIST_MAX 255 |
| 85 | #define ZTE_WMS_DB_EXECSQL_LEN 1024 |
| 86 | #define ZTE_WMS_SEND_NUM_MAX 5 |
| 87 | #define ZTE_WMS_ADDRESS_LEN_MAX 32 |
| 88 | #define ZTE_WMS_SMS_COUNT_MAX 10 |
| 89 | #define ZTE_WMS_DB_MSG_COUNT_MAX (ZTE_WMS_DELETE_COUNT_MAX) |
| 90 | #define ZTE_WMS_CONCAT_SMS_COUNT_MAX 10 |
| 91 | #define ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX 160 |
| 92 | #define ZTE_WMS_ADDRESS_DIGIT_MAX_V01 21 |
| 93 | |
| 94 | |
| 95 | /************************************************************************** |
| 96 | * Êý¾Ý½á¹¹¶¨ÒåÇø |
| 97 | **************************************************************************/ |
| 98 | /* smsµÄ²Ù×÷ÀàÐÍ */ |
| 99 | typedef enum { |
| 100 | WMS_SMS_CMD_NONE = 0, |
| 101 | |
| 102 | WMS_SMS_CMD_INIT, |
| 103 | WMS_SMS_CMD_GET_MEM_CAPABILITY, |
| 104 | |
| 105 | WMS_SMS_CMD_CFG_SET_PARAMETERS, |
| 106 | WMS_SMS_CMD_MSG_SEND, |
| 107 | WMS_SMS_CMD_MSG_WRITE, |
| 108 | WMS_SMS_CMD_MSG_DELETE, |
| 109 | WMS_SMS_CMD_MSG_MODIFY_TAG, |
| 110 | WMS_SMS_CMD_MSG_REPLY, |
| 111 | |
| 112 | WMS_SMS_CMD_SMS_INIT_LOAD, |
| 113 | WMS_SMS_CMD_SMS_LOAD_COMPLETE, |
| 114 | |
| 115 | WMS_SMS_CMD_RECEIVE_MSG, |
| 116 | WMS_SMS_CMD_SLEEP_WAKEUP, |
| 117 | |
| 118 | WMS_SMS_CMD_RESTORE, |
| 119 | |
| 120 | WMS_SMS_CMD_WMS_MAX |
| 121 | } T_zUfiSms_CmdType; |
| 122 | |
| 123 | typedef enum { |
| 124 | WMS_CMD_NONE = 0x00, |
| 125 | WMS_CMD_PROCESSING, |
| 126 | WMS_CMD_FAILED, |
| 127 | WMS_CMD_SUCCESS, |
| 128 | WMS_CMD_CONFLICT, /*WHEN db data conflict with sim card or nv */ |
| 129 | WMS_CMD_STATUS_MAX = 0x1000 |
| 130 | } T_zUfiSms_CmdStatus; |
| 131 | |
| 132 | |
| 133 | typedef enum { |
| 134 | ZTE_SMS_CMS_NONE = 0, |
| 135 | ZTE_SMS_CMS_ME_FAILURE = 300, |
| 136 | ZTE_SMS_CMS_SERVICE_RESERVED = 301, |
| 137 | ZTE_SMS_CMS_OP_NOT_ALLOWED = 302, |
| 138 | ZTE_SMS_CMS_OP_NOT_SUPPORTED = 303, |
| 139 | ZTE_SMS_CMS_INVALID_PDU_PARAM = 304, |
| 140 | ZTE_SMS_CMS_INVALID_TXT_PARAM = 305, |
| 141 | ZTE_SMS_CMS_SIM_NOT_INSERTED = 310, |
| 142 | ZTE_SMS_CMS_SIM_PIN_REQ = 311, |
| 143 | ZTE_SMS_CMS_PHSIM_PIN_REQ = 312, |
| 144 | ZTE_SMS_CMS_SIM_FAILURE = 313, |
| 145 | ZTE_SMS_CMS_SIM_BUSY = 314, |
| 146 | ZTE_SMS_CMS_SIM_WRONG = 315, |
| 147 | ZTE_SMS_CMS_SIM_PUK_REQ = 316, |
| 148 | ZTE_SMS_CMS_SIM_PIN2_REQ = 317, |
| 149 | ZTE_SMS_CMS_SIM_PUK2_REQ = 318, |
| 150 | ZTE_SMS_CMS_MEM_FAILURE = 320, |
| 151 | ZTE_SMS_CMS_INVALID_INDEX = 321, |
| 152 | ZTE_SMS_CMS_MEM_FULL = 322, |
| 153 | ZTE_SMS_CMS_SCA_ADDR_UNKNOWN = 330, |
| 154 | ZTE_SMS_CMS_NO_SERVICE = 331, |
| 155 | ZTE_SMS_CMS_NETWORK_TIMEOUT = 332, |
| 156 | ZTE_SMS_CMS_CNMA_NOT_EXP = 340, |
| 157 | ZTE_SMS_CMS_UNKNOWN_ERR = 500, |
| 158 | ZTE_SMS_CMS_MAX = 512 |
| 159 | } T_zUfiSms_ErrorType; |
| 160 | |
| 161 | |
| 162 | //µ±Ç°Á÷³ÌµÄ״̬ÐÅÏ¢ |
| 163 | typedef struct { |
| 164 | T_zUfiSms_CmdType cmd; //µ±Ç°µÄÒµÎñÁ÷³Ì±ê¼Ç£¬·¢¡¢ÊÕ¡¢É¾µÈ |
| 165 | T_zUfiSms_CmdStatus cmd_status; |
| 166 | T_zUfiSms_ErrorType err_code; |
| 167 | int send_failed_count; |
| 168 | int delete_failed_count; |
| 169 | } T_zUfiSms_StatusInfo; |
| 170 | |
| 171 | /*Ð޸IJÎÊý*/ |
| 172 | typedef struct { |
| 173 | unsigned char tags; |
| 174 | unsigned int total_id; |
| 175 | unsigned int type; |
| 176 | unsigned int id[ZTE_WMS_DB_MSG_COUNT_MAX]; |
| 177 | } T_zUfiSms_ModifyFlag; |
| 178 | |
| 179 | typedef struct { |
| 180 | unsigned char sca[ZTE_WMS_ADDRESS_DIGIT_MAX_V01 + 1]; /*read from the sim card,null terminated */ |
| 181 | unsigned int mem_store; /*´æ´¢Î»Ö㬠Sim»òNv*/ |
| 182 | unsigned int tp_validity_period; /* [0,255], initial vaule=255 */ |
| 183 | unsigned int status_report_on; /*1-->open, 0-->close, initial vaue=0 */ |
| 184 | unsigned int sendfail_retry_on; /*1-->open, 0-->close, initial vaue=0 */ |
| 185 | unsigned int outdate_delete_on; /*1-->open, 0-->close, initial vaue=0 */ |
| 186 | unsigned char default_store[10]; /*nv, sim, initial vaue=nv */ |
| 187 | } zte_wms_parameter_info_s_type, T_zUfiSms_ParaInfo; |
| 188 | |
| 189 | |
| 190 | typedef struct { |
| 191 | unsigned char year[5]; |
| 192 | unsigned char month[3]; |
| 193 | unsigned char day[3]; |
| 194 | unsigned char hour[3]; |
| 195 | unsigned char min[3]; |
| 196 | unsigned char sec[3]; |
| 197 | unsigned char timezone[4];//ʱ¼äÒª¸ú×ÅÊ±Çø×öЩµ÷Õû |
| 198 | } T_zUfiSms_Date; |
| 199 | |
| 200 | /* ·¢¶ÌÐÅ */ |
| 201 | typedef struct { |
| 202 | unsigned char receiver_count; |
| 203 | unsigned char mem_store; //¶ÌÐŴ洢λÖ㬻ò¿¨£¬»òNV |
| 204 | unsigned char dest_num[ZTE_WMS_SEND_NUM_MAX][ZTE_WMS_ADDRESS_LEN_MAX + 1]; //ÊÕ¼þÈË |
| 205 | unsigned short msg_len; |
| 206 | |
| 207 | unsigned char dcs; /* ±àÂë¸ñʽ 1-->ASCII, 2-->UNICODE, 3-->GSM7 SPANISH, 4-->GSM7 DEFAULT, 5-->GSM7 PORTUGUESE*/ |
| 208 | unsigned char tags; /* ¶ÌÐÅÊÕ·¢×´Ì¬ */ |
| 209 | unsigned char isDelete; //ÖÃ1ÔòÐèɾ³ý¸Ã¶ÌÐÅ |
| 210 | |
| 211 | long id; // ¶ÌÐŵÄË÷Òý,webÉÏн¨¶ÌÐÅÌî-1£¬²Ý¸åÏäÖеĶÌÐÅ·¢ËÍʱЯ´øÊý¾Ý¿âΪÆä·ÖÅäµÄid |
| 212 | T_zUfiSms_Date date; |
| 213 | unsigned char draft_group_id[32]; //´æ²Ý¸åʱʹÓà |
| 214 | } T_zUfiSms_SendReq, T_zUfiSms_SaveReq; |
| 215 | |
| 216 | |
| 217 | #endif |