blob: 89a70eb9769bef567fb96298d7ff9feb6e036b2c [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001
2
3
4#ifndef boolean
5#define boolean unsigned char
6#endif
7
8#ifndef PBM_MAX_DEL_LEN
9#define PBM_MAX_DEL_LEN 50
10#endif
11
12#ifndef ZTE_PB_INDEX_MAX
13#define ZTE_PB_INDEX_MAX 100
14#endif
15
16#ifndef ZTE_WEB_PBM_REC_LEN
17#define ZTE_WEB_PBM_REC_LEN 32
18#endif
19
20#ifndef PBM_WEB_MAX_CHAR_LEN
21#define PBM_WEB_MAX_CHAR_LEN ZTE_WEB_PBM_REC_LEN*ZTE_PB_INDEX_MAX
22#endif
23
24#ifndef PBM_MAX_NUM_LENGTH
25#define PBM_MAX_NUM_LENGTH 40
26#endif
27
28#ifndef PBM_NUM_SIZE
29#define PBM_NUM_SIZE (PBM_MAX_NUM_LENGTH+2) /* + and null for string */
30#endif
31
32
33#ifndef uint16
34#define uint16 unsigned short
35#endif
36
37#ifndef PBM_MAX_TEXT_LENGTH
38#define PBM_MAX_TEXT_LENGTH 90
39#endif
40
41#ifndef PBM_TEXT_SIZE_CHARS
42#define PBM_TEXT_SIZE_CHARS (PBM_MAX_TEXT_LENGTH+1) /* Null terminated string */
43#endif
44
45#ifndef PBM_TEXT_SIZE_BYTES
46#define PBM_TEXT_SIZE_BYTES (PBM_TEXT_SIZE_CHARS*sizeof(uint16)) /* size in bytes */
47#endif
48
49#ifndef ZTE_PBM_NV
50#define ZTE_PBM_NV "pbm_write_flag"
51#endif
52
53#define PBM_OPRATING "20"
54
55#define PBM_SIM "pbm_sim"
56#define PBM_NATIVE "pbm_native"
57
58//pbm device capacity
59#define PBM_DEV_MAX_RECORD_NUM "pbm_dev_max_record_num"
60#define PBM_DEV_USED_RECORD_NUM "pbm_dev_used_record_num"
61
62//pbm sim capacity
63#define PBM_SIM_SIM_TYPE "pbm_sim_type"
64#define PBM_SIM_MAX_RECORD_NUM "pbm_sim_max_record_num"
65#define PBM_SIM_USED_RECORD_NUM "pbm_sim_used_record_num"
66#define PBM_SIM_MAX_NAME_LEN "pbm_sim_max_name_len"
67#define PBM_SIM_MAX_NUMBER_LEN "pbm_sim_max_number_len"
68#define PBM_SIM_MAX_ANR_NUM "pbm_sim_max_anr_num"
69#define PBM_SIM_MAX_ANR_LEN "pbm_sim_max_anr_len"
70#define PBM_SIM_MAX_ANR1_NUM "pbm_sim_max_anr1_num"
71#define PBM_SIM_MAX_ANR1_LEN "pbm_sim_max_anr1_len"
72#define PBM_SIM_MAX_EMAIL_NUM "pbm_sim_max_email_num"
73#define PBM_SIM_MAX_EMAIL_LEN "pbm_sim_max_email_len"
74#define PBM_SIM_MAX_SNE_LEN "pbm_sim_max_sne_len"
75
76#define ZTE_WEB_PBM_NUMBER_TYPE_1 145
77#define ZTE_WEB_PBM_NUMBER_TYPE_2 129
78#define ZTE_WEB_PBM_NUMBER_TYPE_SPLIT '+'
79#define ZTE_WEB_PBM_NUMBER_TYPE_START 0
80#define ZTE_WEB_PBM_PAGE_DEL_PART "delete_num"
81#define ZTE_WEB_PBM_PAGE_DEL_ALL "delete_all"
82#define ZTE_WEB_PBM_DEL_BY_GROUP "delete_all_by_group"
83#define ZTE_WEB_PBM_REC_LEN 32
84#define ZTE_WEB_PBM_INDEX_SPLIT_FLAG ','
85#define ZTE_WEB_PBM_DEL_MULT_OR_ONE_FLAG 1
86#define ZTE_WEB_PBM_DEL_MULT_FLAG 0
87#define ZTE_WEB_PBM_DEL_ONE_IND 0
88#define ZTE_WEB_PBM_MEM_SIM 0
89
90#define PBM_PAGE_RECORD_MAX_NUM 10
91
92#define PBM_DATA "pbm_data"
93
94#define PBM_ID "pbm_id"
95#define PBM_INDEX "pbm_index"
96#define PBM_LOCATION "pbm_location"
97#define PBM_NAME "pbm_name"
98#define PBM_NUMBER "pbm_number"
99#define PBM_TYPE "pbm_type"
100#define PBM_ANR "pbm_anr"
101#define PBM_ANR1 "pbm_anr1"
102#define PBM_EMAIL "pbm_email"
103#define PBM_SNE "pbm_sne"
104#define PBM_GROUP "pbm_group"
105
106typedef struct zte_pbm_create_ext_record_s_type {
107 int zte_pbm_id; //the id in the pbm table,unique,ASC
108 int zte_pbm_index;
109 int zte_pbm_location;
110 char zte_pbm_name[PBM_TEXT_SIZE_BYTES];
111 char zte_pbm_number[PBM_NUM_SIZE];
112 int zte_pbm_type;
113 char zte_pbm_anr[PBM_NUM_SIZE];
114 char zte_pbm_anr1[PBM_NUM_SIZE];
115 char zte_pbm_email[PBM_TEXT_SIZE_BYTES];
116 //char zte_pbm_sne[PBM_TEXT_SIZE_BYTES];
117 //char zte_pbm_group[PBM_TEXT_SIZE_BYTES];
118 char zte_pbm_sne[32];// 91*2 ---> 32 ÔÝʱδÓõ½¸Ã²ÎÊý
119 char zte_pbm_group[32]; // 91*2 ---> 32
120 int zte_pbm_del_id;
121} zte_pbm_create_ext_record_s_type;
122
123
124
125typedef enum zte_web_pbm_contact_save {
126 ZTE_WEB_PBM_CONTACT_SIM,
127 ZTE_WEB_PBM_CONTACT_PC,
128
129 ZTE_WEB_PBM_MAX
130} zte_web_pbm_contact_save_e_type;
131
132typedef struct zte_pbm_del_multi_records_s_type {
133 int zte_del_pbm_id[PBM_MAX_DEL_LEN];
134 int zte_del_pbm_total;
135 int zte_del_pbm_location;
136 int zte_del_pbm_index[PBM_MAX_DEL_LEN];
137} zte_pbm_del_multi_records_s_type;
138
139
140typedef enum {
141 PBM_LOCATION_SIM = 0, //sim card only,exsit in database
142 PBM_LOCATION_DEVICE = 1, //device only,exit in database
143 PBM_LOCATION_ALL = 2, //sim card and device, not exsit in database, only use in pbm code
144 PBM_LOCATION_GROUP = 3, //group in device,for example:common,family and so on,not exsit in database, only use in pbm code
145
146 PBM_LOCATION_MAX
147} zte_pbm_location_e_type;
148
149typedef struct {
150 uint8 page;
151 uint8 num_per_page;
152 zte_pbm_location_e_type location;
153 boolean asc_flag;
154 uint8 order_by;
155} zte_pbm_query_req_s_type;
156
157
158
159
160typedef struct {
161 uint8 count;
162 zte_pbm_create_ext_record_s_type data[0]; /*lint !e1501*/
163} zte_pbm_query_resp_s_type;
164
165
166typedef struct {
167 int sim_type;
168 int max_record_number;
169 int used_record_number;
170 int max_name_len;
171 int max_number_len;
172 int max_anr_num;
173 int max_anr_len;
174 int max_anr1_num;
175 int max_anr1_len;
176 int max_email_num;
177 int max_email_len;
178 int max_sne_len;
179} zte_pbm_sim_capability_s_type;
180
181
182typedef struct {
183 int max_record_number;
184 int used_record_number;
185} zte_pbm_device_capability_s_type;
186
187extern void zte_rest_get_pbm_data_head(webs_t wp);
188extern void zte_rest_get_pbm_data_foot(webs_t wp);
189extern void zte_rest_get_pbm_data_sim(webs_t wp, zte_pbm_query_resp_s_type *p_pbm_query_result, int index, int tag);
190extern void zte_rest_get_pbm_data_other(webs_t wp, zte_pbm_query_resp_s_type *p_pbm_query_result, int index, int tag);
191
192
193
194