blob: f337fd6662197dfae7d5663b1eb697006fd6500d [file] [log] [blame]
/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
SHORT MESSAGES SERVICES(SMS) MODULE
GENERAL DESCRIPTION
created by huojianlei for short messages services(SMS) module
Author Date
----------------------------------------------------------------------------------------------
huojianlei 20120201
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
#ifndef _LIBZTE_WMS_H_
#define _LIBZTE_WMS_H_
/*===========================================================================
INCLUDES
===========================================================================*/
#include "softap_api.h"
#define DCS_ASC 1
#define DCS_USC 2
#define DCS_UNKNOW 0
#define DCS_UNICODE 2
#define DCS_SPANISH 3
#define DCS_GSM7_DEFAULT 4
#define DCS_TURKISH 6
// #include "zte_topsw_wms_type.h"
typedef struct
{
unsigned char year[5];
unsigned char month[3];
unsigned char day[3];
unsigned char hour[3];
unsigned char min[3];
unsigned char sec[3];
unsigned char timezone[4];
}zte_wms_sms_date;
/* gsdi card mode */
typedef enum
{
ZTE_WMS_GSDI_CARD_MODE_NONE=0X00,
ZTE_WMS_GSDI_CARD_MODE_UIM,
ZTE_WMS_GSDI_CARD_MODE_USIM
} zte_wms_gsdi_card_mode_e_type;
/*sleep and wakeup message */
typedef enum
{
ZTE_WMS_SLEEP_TYPE=0,
ZTE_WMS_WAKEUP_TYPE
} zte_wms_sleep_wakeup_e_type;
#define ZTE_WMS_DELETE_COUNT_MAX1 (100)
typedef struct
{
unsigned long nv_count;
unsigned long nv_index_count;
unsigned long nv_index;
unsigned long nv_id[ZTE_WMS_DELETE_COUNT_MAX1];
unsigned long sim_count;
unsigned long sim_index_count;
unsigned long sim_index;
unsigned long sim_id[ZTE_WMS_DELETE_COUNT_MAX1];
unsigned long sim_indices[ZTE_WMS_DELETE_COUNT_MAX1];
}zte_wms_delete_msg_ui_rsp_s_type;
typedef struct
{
T_zUfiSms_CmdType cmd;
T_zUfiSms_CmdStatus cmd_status;
/*err_code can be used when sending msg, writting msg and setting sms parameters*/
T_zUfiSms_ErrorType err_code; /*reference to CMS error code */
unsigned int send_failed_count;
unsigned int delete_failed_count;
zte_wms_delete_msg_ui_rsp_s_type delete_result;
}zte_wms_cmd_status_info_s_type;
typedef struct
{
unsigned int received_new_sms;
unsigned int sms_capacity;
unsigned int total_count;
unsigned int unread_count;
int is_full;
}zte_wms_led_sms_info_s_type;
/*-----------------------------------------------------------------------------
* This code must sync with the libzte_mc.h
*-----------------------------------------------------------------------------*/
#ifndef ZTE_MC_WMS_TYPE
#define ZTE_MC_WMS_TYPE
#define ZTE_WMS_MESSAGE_LIST_MAX 255
#define ZTE_WMS_DB_EXECSQL_LEN 1024
#define ZTE_WMS_SEND_NUM_MAX (5)
#define ZTE_WMS_ADDRESS_DIGIT_MAX_V01 21
#define ZTE_WMS_ADDRESS_LEN_MAX 32
#define ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX (160)
/*DELETE_COUNT_MAX*/
#ifdef CONFIG_MIN_8M_VERSION
#define ZTE_WMS_DELETE_COUNT_MAX (20)
#else
#define ZTE_WMS_DELETE_COUNT_MAX (100)
#endif
#define ZTE_WMS_DB_MSG_COUNT_MAX (ZTE_WMS_DELETE_COUNT_MAX)
#define ZTE_WMS_CMD_DELETE_BUFFER_LEN_MAX (ZTE_WMS_DELETE_COUNT_MAX * 6)
/*support MAX COUNT NUMBER*/
#define ZTE_WMS_RECEIVER_NUM_MAX (50)
#define ZTE_WMS_SMS_MSG_CHAR_MAX (140)
#define ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX (2 * ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX)
#define ZTE_WMS_SMS_COUNT_MAX (10)
#ifdef CUSTOM_VERSION_MF253S2_CM_CN
#define ZTE_WMS_CONCAT_SMS_COUNT_MAX (10)// 1-->5 liuqg for concat sms
#else
#define ZTE_WMS_CONCAT_SMS_COUNT_MAX (10)
#endif
#define ZTE_WMS_SMS_CONCAT_CONTENT_LEN_MAX (2 * ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX * ZTE_WMS_CONCAT_SMS_COUNT_MAX)
#define ZTE_WMS_SCA_LEN_MAX (32)
#define ZTE_WMS_TP_SCTS_LEN_MAX (50) /*modified by crw*/
#define ZTE_WMS_SMS_UD_HEADER_LEN_MAX (30)
#define ZTE_WMS_SMS_CONCAT_ELEMNT_MAX (3)
#define ZTE_WMS_SMS_CONCAT_ELEMNT_ASC_LEN (153)
#define ZTE_WMS_SMS_CONCAT_ELEMNT_UCS_LEN (67)
typedef unsigned char boolean; /* Boolean value type. */
//typedef int wms_message_index_type;
/*wms database*/
typedef enum
{
ZTE_WMS_TABLE_SIM = 0,
ZTE_WMS_TABLE_NV,
ZTE_WMS_TABLE_CMD_STATUS,
ZTE_WMS_TABLE_SMS_REPORT,
ZTE_WMS_TABLE_PAR,
ZTE_WMS_STORE_MAX
}zte_wms_db_store_e_type;
typedef struct
{
unsigned char content[1024];
} zte_wms_cell_bro_s_type;
/*for sending msg req*/
typedef struct
{
unsigned char receiver_count;
unsigned char mem_store;
unsigned char dest_num[ZTE_WMS_SEND_NUM_MAX][ZTE_WMS_ADDRESS_LEN_MAX+1];
unsigned short msg_len; /*message length in byte */
//unsigned char msg_content[ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX * ZTE_WMS_CONCAT_SMS_COUNT_MAX *2];
unsigned char msg_content[2]; // ÄÚÈÝͨ¹ýÊý¾Ý¿â´«µÝ£¬²»Ê¹ÓøòÎÊýÁË
unsigned char dcs; /*1-->ASCII, 2-->UNICODE, 3-->GSM7 SPANISH, 4-->GSM7 DEFAULT, 5-->GSM7 PORTUGUESE*/
unsigned char tags; /* for pc client */
boolean isReply;
boolean isDelete;
long id; // for reply
zte_wms_db_store_e_type db;
zte_wms_sms_date date;
unsigned char draft_group_id[32];
} zte_wms_send_msg_ui_req_s_type;
typedef zte_wms_send_msg_ui_req_s_type zte_wms_write_msg_info_s_type;
#if 0
typedef struct
{
int id;
} zte_wms_send_msg_ui_req_s_type;
typedef zte_wms_send_msg_ui_req_s_type zte_wms_write_msg_info_s_type;
#endif
/*modify msg tag req */
typedef struct
{
zte_wms_db_store_e_type db;
unsigned long id_index;
unsigned short total_indices;
unsigned short num_of_indices; /* Total indices */
unsigned int indices[ZTE_WMS_MESSAGE_LIST_MAX];
} zte_wms_modify_msg_tag_info_s_type;
/*for deleting msg req*/
typedef struct
{
unsigned char tags;
unsigned int total_id;
unsigned int id[ZTE_WMS_DB_MSG_COUNT_MAX];
} zte_wms_modify_tag_s_type;
/*for deleting msg req*/
typedef struct
{
zte_wms_db_store_e_type db;
unsigned int all_or_count; /*all_or_count=0--->delete all,others--->delete partial sms*/
unsigned int id[ZTE_WMS_DELETE_COUNT_MAX];
unsigned char sql[2];// δÓõ½¸Ã²ÎÊý
} zte_wms_del_msg_s_type;
/*stucture for deleting cmd status report stored in db table */
#endif // ZTE_MC_WMS_TYPE
/*-----------------------------------------------------------------------------
* Sync data end
*-----------------------------------------------------------------------------*/
typedef struct {
char id[10];
char number [ZTE_WMS_ADDRESS_LEN_MAX + 1];
char sms_content[2*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX * ZTE_WMS_CONCAT_SMS_COUNT_MAX + 1];
char tag[10];
zte_wms_sms_date date;
char draft_group_id[32];
} zte_sms_data;
#if 0 // Ô­À´²»Ö§³Ö¼¶Áª¶ÌÐŵĴúÂë
typedef struct {
char id[10];
char number [ZTE_WMS_ADDRESS_LEN_MAX + 1];
char sms_content[2*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX *ZTE_WMS_CONCAT_SMS_COUNT_MAX + 1];
char tag[10];
zte_wms_sms_date date;
char draft_group_id[32];
} zte_sms_data;
#endif
/* ---------- end of struct sms_data ---------- */
typedef struct {
unsigned char page;
unsigned char data_per_page;
unsigned char mem_store;
unsigned char tags;
unsigned char order_by[256];
} zte_sms_query_req ;
/* ---------- end of struct sms_query_req ---------- */
typedef struct {
unsigned char count;
zte_sms_data data[0];/*lint !e1501*/
} zte_sms_query_result;
typedef struct {
char id[10];
char bcm_srv_id [ZTE_WMS_ADDRESS_LEN_MAX + 1];
char total_pages[10];
char page_number[10];
char geo_scope[10];
char mesage_code[10];
char raw_serial_number[10];
char raw_dcs_data[10];
char update_number[10];
char alphabet[10];
char language[10];
char sm_len[10];
char sm_data[2*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX * ZTE_WMS_CONCAT_SMS_COUNT_MAX + 1];
} zte_bcm_data;
typedef struct {
unsigned char count;
zte_bcm_data data[0]; /*lint !e1501*//*lint !e43*/
} zte_bcm_query_result;
/*for deleting broadcast msg req*/
typedef struct
{
zte_wms_db_store_e_type db;
unsigned long all_or_count; /*all_or_count=0--->delete all,others--->delete partial cbm*/
unsigned long id[ZTE_WMS_DELETE_COUNT_MAX];
unsigned char sql[ZTE_WMS_DB_EXECSQL_LEN];
} zte_wms_del_bcm_msg_s_type;
/*===========================================================================
FUNCTIONS
===========================================================================*/
#if 0 //unused
int zte_libwms_set_parameter
(
zte_wms_parameter_info_s_type *para_ptr
);
int zte_libwms_send_msg
(
zte_wms_send_msg_ui_req_s_type *msg_ptr
);
int zte_libwms_write_msg
(
zte_wms_write_msg_info_s_type *msg_ptr
);
int zte_libwms_delete_msg
(
zte_wms_del_msg_s_type *del_info_ptr
);
int zte_libwms_modify_tag
(
zte_wms_modify_tag_s_type *modify_ptr
);
int zte_libwms_init_load_msg
(
zte_wms_gsdi_card_mode_e_type card_mode
);
int zte_libwms_sleep_wakeup_msg
(
zte_wms_sleep_wakeup_e_type sleep_wakeup_type
);
#endif
int zte_libwms_get_cmd_status(zte_wms_cmd_status_info_s_type *cmd_status);
int
zte_libwms_get_sms_data (zte_sms_query_req *req, zte_sms_query_result *result);
int
zte_libwms_get_sms_report (zte_sms_query_req *req, zte_sms_query_result *result);
int zte_libwms_get_parameter(zte_wms_parameter_info_s_type *para);
int
zte_libwms_get_sms_used (int mem_store,int tags);
int
zte_libwms_get_sms_capability (int mem_store);
int
zte_libwms_restore_sms(boolean isDelete);
int zte_libwms_led_get_sms_received();
int zte_libwms_led_get_sms_information(zte_wms_led_sms_info_s_type *sms_info);
int zte_libwms_get_cell_bro(zte_wms_cell_bro_s_type *para);
int zte_libwms_db_write_send_msg_content_data (char *content);
int zte_libwms_setSmsCmdStatus(zte_wms_cmd_status_info_s_type *ptSetStatus);
//for traffic sms
int zte_libwms_get_traffic_sms_body(long id, char *body);
typedef struct
{
int count;
char id[10][20];
} zte_wms_traffic_sms_id;
int zte_libwms_get_traffic_sms_id(char *str_id, int *count);
#endif /*_LIBZTE_WMS_H_*/