-
Notifications
You must be signed in to change notification settings - Fork 0
/
g_config.h
executable file
·191 lines (160 loc) · 6.1 KB
/
g_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*-----------------------------------------*
g_config.h
coded by H.B. Lee
Feb/2007
Revisoned May/2009
*-----------------------------------------*/
#define DBG_MSG_LEVEL 2
#define SV_DBG_MSG_LEVEL 2
#define ND_DBG_MSG_LEVEL 2
#define LOG_MSG_LEVEL 2
#define LOG_FILE_NAME "/tmp/mb3/gtwy.log"
#define LOG_FILE_NAM2 "/tmp/mb3/Eboot.log"
#define EXECUTE_FILE "/tmp/mb3/Egtwy"
#define MY_GATEWAY_ID 0 /* gateway id */
#define NODE_UART_USE 4 /* 400K bps */
#define NODE_UART_DEV "/dev/ttyS?" /* UART device for sink node */
#define NODE_SFMI_SEC 10 /* superframe interval */
#define NODE_IGTR_SEC 3 /* image transmission time */
#define NODE_IOT_MSEC 10 /* maximum read waiting time from node */
#define CDMA_UART_USE 0 /* whether if use CDMA modem */
#define CDMA_UART_DEV "/dev/ttyS?" /* UART device for CDMA modem */
#define CDMA_ATD_NRTY 3 /* max number of retry for ATD command */
#define CDMA_ATD_NSEC 3 /* max waiting time for ATD command */
#define CDMA_RST_NRTY 3 /* max number of retry for CDMA reset */
#define CDMA_RST_NSEC 3 /* max waiting time for CDMA reset */
#define CDMA_TCPC_UID "sktelecom" /* TCP/IP uid for CDMA-1X svc */
#define CDMA_PACK_UID 1501 /* Pcket uid for CDMA-1X svc */
#define CDMA_SRV_ADDR "127.0.0.1" /* TCP/IP addr through CDMA-1X */
#define CDMA_SRV_PORT 2874 /* TCP/IP port through CDMA-1X */
#define CDMA_IOT_MSEC 3000 /* max waiting i/o for read from CDMA*/
#define CDSK_PPPD_USE 1 /* socket with PPP(HSDPA)*/
#define CDSK_PPPD_DEV "/dev/usb_power" /* PPP(HSDPA) device */
#define CDSK_PPPD_TRT 3 /* max comm. time(sec) with servr */
#define CDSK_PPPD_PWT 20 /* ppp device(HSDPA) pwrup time(sec*/
#define CDSK_PPPD_DMT 10 /* ppp deamon bootup time(sec) */
#define CDSK_PPPD_CLT 60 /* ppp device cooling time(sec) */
#define CDSK_SRV_ADDR "127.0.0.1" /* TCP/IP addr for srvr socket */
#define CDSK_SRV_PORT 8888 /* TCP/IP port for srvr socket */
#define CDSK_IOT_MSEC 20000 /* maximum i/o waiting time from node*/
#define SRVR_CONN_FRQ 4 /* sever conn frq. based on super frame*/
#define SRVR_GWST_FRQ 10 /* send gateway status info. frq. */
#define SRVR_GWTM_FRQ 10 /* server time request frq. */
#define GTWY_STAT_FRQ 30 /* staticstics put interval */
#define GTWY_STWC_USE 0
#define GTWY_STWC_DEV "/dev/gpio"
#define GTWY_SWDG_NDF 50 /* node failure allowance */
#define GTWY_SWDG_SVF 20 /* srvr failure allowance */
#define GTWY_HWDG_USE 1
#define GTWY_HWDG_SEC 25
#define GTWY_HWDG_DEV "/dev/misc/S3C2440_watchdog"
//////////////////////////////////////////////
// Queue
#define UP_UGNT_DAT_Q 500
#define UP_NORM_CMD_Q 500
#define UP_UGNT_IMG_Q 50
#define UP_NORM_IMG_Q 50
#define UP_UGNT_BDT_Q 10
#define UP_NORM_BDT_Q 10
#define UP_NORM_DAT_Q 500
#define UP_TNOR_DAT_Q 500
#define UP_TNOR_IG1_Q 50
#define DN_UGNT_CMD_Q 30
#define DN_NORM_CMD_Q 30
#define DN_UNKN_CMD_Q 30
//////////////////////////////////////////////
// retry
#define UP_UGNT_DAT_R 3
#define UP_NORM_CMD_R 3
#define UP_UGNT_IMG_R 3
#define UP_NORM_IMG_R 3
#define UP_UGNT_BDT_R 3
#define UP_NORM_BDT_R 3
#define UP_NORM_DAT_R 3
#define UP_TNOR_DAT_R 3
#define UP_TNOR_IG1_R 3
#define DN_NORM_FMW_R 3
#define DN_UGNT_CMD_R 3
#define DN_NORM_CMD_R 3
#define DN_UNKN_CMD_R 3
/*---------------------------------------------------------------------*/
#define MAX_NODE_PSIZE 256 /* Packet Size */
#define MAX_FIRM_PSIZE 4096
#define MAX_REAL_FSIZE 200 /* Frame Size, real message without esc seq */
#define MAX_CDMA_PSIZE 512 /* Packet Size */
#define MAX_UBUF_NUMBR 8
#define MAX_BINRY_SIZE (100*1024)
#define MAX_FIRMW_SIZE (100*1024)
extern int Dbg_msg_level;
extern int SV_Dbg_msg_level;
extern int ND_Dbg_msg_level;
extern int Log_msg_level;
extern char *Log_file_name;
extern char *Log_file_nam2;
extern char *Execute_file;
extern FILE *Log_dev; /* fp of Log_file_name */
extern int My_gateway_id;
extern int Node_uart_use;
extern char *Node_uart_dev;
extern int Node_sfmi_sec;
extern int Node_igtr_sec;
extern int Node_iot_msec;
extern int Cdma_uart_use;
extern char *Cdma_uart_dev;
extern int Cdma_atd_nrty;
extern int Cdma_atd_nsec;
extern int Cdma_rst_nrty;
extern int Cdma_rst_nsec;
extern char *Cdma_tcpc_uid;
extern int Cdma_pack_uid;
extern char *Cdma_srv_addr;
extern int Cdma_srv_port;
extern int Cdma_iot_msec;
extern int Cdsk_pppd_use;
extern char *Cdsk_pppd_dev;
extern int Cdsk_pppd_trt;
extern int Cdsk_pppd_pwt;
extern int Cdsk_pppd_dmt;
extern int Cdsk_pppd_clt;
extern char *Cdsk_srv_addr;
extern int Cdsk_srv_port;
extern int Cdsk_iot_msec;
extern int Srvr_conn_frq;
extern int Srvr_gwst_frq;
extern int Srvr_gwtm_frq;
extern int Gtwy_stat_frq;
extern int Gtwy_stwc_use;
extern char *Gtwy_stwc_dev;
extern int Gtwy_swdg_ndf;
extern int Gtwy_swdg_svf;
extern int Gtwy_hwdg_use;
extern int Gtwy_hwdg_sec;
extern char *Gtwy_hwdg_dev;
extern char *Stop_watc_dev;
extern char *Watch_dog_dev;
extern int Up_ugnt_dat_q;
extern int Up_norm_cmd_q;
extern int Up_norm_dat_q;
extern int Up_ugnt_img_q;
extern int Up_norm_img_q;
extern int Up_ugnt_bdt_q;
extern int Up_norm_bdt_q;
extern int Up_tnor_dat_q;
extern int Up_tnor_ig1_q;
extern int Dn_norm_fmw_q;
extern int Dn_ugnt_cmd_q;
extern int Dn_norm_cmd_q;
extern int Dn_unkn_cmd_q;
extern int Up_ugnt_dat_r;
extern int Up_norm_cmd_r;
extern int Up_norm_dat_r;
extern int Up_ugnt_img_r;
extern int Up_norm_img_r;
extern int Up_ugnt_bdt_r;
extern int Up_norm_bdt_r;
extern int Up_tnor_dat_r;
extern int Up_tnor_ig1_r;
extern int Dn_norm_fmw_r;
extern int Dn_ugnt_cmd_r;
extern int Dn_norm_cmd_r;
extern int Dn_unkn_cmd_r;