comparison gsm-fw/L1/cust0/mv100/L1tm_cust_add.h @ 517:eafadfee35b2

gsm-fw/L1/cust?: imported Leonardo, LoCosto and MV100 versions
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 10 Jul 2014 03:43:04 +0000
parents
children
comparison
equal deleted inserted replaced
516:78495749970a 517:eafadfee35b2
1 #ifndef _DEF_BMI_L1TMCUSTADD_H_
2 #define _DEF_BMI_L1TMCUSTADD_H_
3 /************* Revision Controle System Header *************
4 * GSM Layer 1 software
5 * L1TM_CUST_ADD.h
6 *
7 * Filename %M%
8 * Version %I%
9 * Date %G%
10 *
11 * $History: Mmidict.c
12
13 01/08/02 huangxl creat.
14 * $end
15 ************* Revision Controle System Header *************/
16
17 #define EQ ==
18 #define NEQ !=
19 #define AND &&
20 #define OR ||
21 #define XOR(A,B) ((!(A) AND (B)) OR ((A) AND !(B)))
22
23 #define GPIO_OUT 0xFFFE4802
24 #define ALLOC_MEMORY mfwAlloc
25 #define FREE_MEMORY mfwFree
26
27
28 #ifndef FALSE
29 #define FALSE 0
30 #endif
31
32 #ifndef TRUE
33 #define TRUE 1
34 #endif
35
36 #ifndef NULL
37 #define NULL 0
38 #endif
39
40 enum CUSTOM_INDEX
41 {
42 OFF = 0,
43 ON = 1
44 };
45
46 enum CMD
47 {
48 READ_SIM_PHB_CMD = 17,
49 WRITE_SIM_PHB_CMD = 18,
50 READ_SIM_SMS_CMD = 19,
51 READ_NEW_SMS_CMD = 21,
52 SEND_SMS_CMD =22 ,
53 SAVE_SEND_SMS =23,
54 WRITE_NVM_PHB_CMD = 24
55
56 };
57
58 enum PC_CMD_RET
59 {
60 CMD_RET_OK =0,
61 CMD_COMPLETE_OK =1,
62 SIM_NOT_REDAY =-1,
63 NO_SIM_PHB =-2,
64 FWRITE_FAIL =-3,
65 CMD_BUSY =-4,
66 FREAD_FAIL =-5,
67 WRITE_SIM_PHB_FAIL =-6,
68 READ_SIM_PHB_FAIL =-7,
69 ALLOC_MEM_FAIL =-8,
70 NO_SIM_SMS =-9
71 };
72
73 #define MAXNAMELEN 21
74 #define MAXNUMLEN 21
75 #define MAXOFFNUMLEN 21
76 #define MAXHOMNUMLEN 21
77 #define MAXEMAILLEN 25
78 #define MAXGROUPLEN 10
79 #define MAXPRILEN 8
80 #define MAXSIMPHBNUM 20
81
82 typedef struct TSPhbData
83 {
84 char Name[21];
85 char Number[21];
86 }SPhbData;
87
88 typedef struct TPhbData
89 {
90 SPhbData phbdata[20];
91 }PhbData;
92
93 typedef struct TPCCMDSTATUS
94 {
95 unsigned char isPcCmdRun;//when pc cmd is complete,it is 1;when running is 0,default is 1
96 unsigned char SimPhbNum;//how many phb num in sim
97 unsigned char NvmPhbNum;//how many phb num in nvm
98 unsigned char nSimSmsFile;//how many sms file created
99 unsigned char isdelsmsok;//
100 unsigned char nNewsms;//how many new sms
101 unsigned char iscmdreterr;//
102 unsigned char nsimphbmax;//how many sms file created
103 unsigned char nsimsmsmax;//how many sms file created
104 unsigned char isPcConect;//conect:1 no dataline in:0
105 }PCCMDSTATUS;
106
107 typedef struct TSMS_MEM_INFO
108 {
109 unsigned char mem;
110 unsigned char used;
111 unsigned char total;
112 unsigned char dummy;
113 } SMS_MEM_INFO;
114
115 #define MAX_LEN 21
116
117 typedef struct
118 {
119 char date[18];
120 char Number[41];
121 char info[502];
122 char sc_addr[MAX_LEN]; /* service centre address */
123 char type;
124 char ton;
125 char npi;
126 char index;
127 }TPhoneSmsItem;
128
129 extern int write_imei(unsigned char *imei);
130 extern int write_SerialNumber(unsigned char *value);
131 extern int read_SerialNumber(char *table);
132 extern unsigned short checksim();
133 extern unsigned short checknetavail();
134 extern unsigned char ctrlcd(unsigned short value);
135 extern unsigned char ctrled(unsigned short value);
136 extern unsigned char ctrbacklight(unsigned short value);
137 extern unsigned char ctrvibrator(unsigned short value);
138 extern unsigned char ctrbuzzer(unsigned short value);
139 extern int key_simulation(unsigned char size,unsigned char *keycode);
140 extern int read_rtc(char *table);
141
142 extern unsigned short get_sim_status(void);
143 extern unsigned short get_net_status(void);
144
145 extern void kbd_test (unsigned char key);
146
147 extern void StartVibrator(void);
148 extern void StopVibrator(void);
149 extern void StartTone(void);
150 extern void StopTone(void);
151
152
153 extern void LED_ON(void);
154 extern void LED_OFF(void);
155 extern void Backlight_ON(void);
156 extern void Backlight_OFF(void);
157
158
159 extern signed char flash_write();
160
161 extern int read_sim_phb(void);
162 extern int write_sim_phb(void);
163 extern unsigned char IsPcCmdExcuteEnd(char *value);
164 extern int write_sim_phb_cb(void);
165 extern void tell_simphb_num(unsigned short value);
166 extern int read_sim_sms(void);
167 extern void Get_sms_info(const char *info,void *adr, void * t,void *scaddr,int errStatus);
168
169 extern int del_sim_sms(unsigned short value);
170 extern int read_new_sms(void);
171 extern int change_sim_sms(unsigned short value);
172 extern int send_sms(void);
173 extern int send_sms_cb(void);
174 extern void tell_nvmphb_num(unsigned short value);
175
176
177 extern PCCMDSTATUS PcCmdStatus;
178 extern unsigned char command;
179
180
181 #endif