FreeCalypso > hg > leo2moko-debug
comparison g23m/condat/ms/src/aci/line_edit.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : | |
4 | Modul : line | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This modul ... | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef LINE_EDIT_H | |
22 #define LINE_EDIT_H | |
23 | |
24 /* | |
25 **************************************************************************************************** | |
26 * public stuff * | |
27 **************************************************************************************************** | |
28 */ | |
29 typedef enum | |
30 { | |
31 LEDIT_FAIL = -1, | |
32 LEDIT_EXCT = 0, | |
33 LEDIT_CMPL, | |
34 LEDIT_COLLECT, | |
35 LEDIT_ESC, /* in text mode do nothing when received ESC */ | |
36 LEDIT_OK, /* for single <CR> and simple "AT<CR>" */ | |
37 LEDIT_IGNORE /* ignore chars before A and between A..T */ | |
38 } T_LEDIT_RSLT; | |
39 | |
40 #define LEDIT_ERR_NONE -1 | |
41 | |
42 typedef enum | |
43 { | |
44 /*000*/ LEDIT_ERR_NoMemory = 0, | |
45 /*001*/ LEDIT_ERR_NoMaintenance, | |
46 /*002*/ LEDIT_ERR_NoValidCommand, | |
47 /*003*/ LEDIT_ERR_LastCmdPending, | |
48 /*004*/ LEDIT_ERR_Unknown | |
49 } T_LEDIT_ERR_CODE; | |
50 | |
51 typedef struct /* error code - error message mapping */ | |
52 { | |
53 CHAR* msg; /* error message */ | |
54 T_LEDIT_ERR_CODE code; /* error code */ | |
55 } T_LEDIT_ERR; | |
56 | |
57 | |
58 typedef enum | |
59 { | |
60 LEDIT_CTRL_ERROR, | |
61 LEDIT_CTRL_CMPL, | |
62 LEDIT_CTRL_REMOVE_SRC, | |
63 LEDIT_CTRL_PROMPT, | |
64 LEDIT_CTRL_CRLF_PROMPT, | |
65 LEDIT_CTRL_MORE_CMDS | |
66 } T_LEDIT_CTRL; | |
67 | |
68 | |
69 typedef struct | |
70 { | |
71 UBYTE S3; /* CR */ | |
72 UBYTE S4; /* LF */ | |
73 UBYTE S5; /* BS */ | |
74 UBYTE atE; /* Command Echo: ON */ | |
75 UBYTE smsEnd;/* want to be non V25.ter conform */ | |
76 } T_LEDIT; /* initial = {13, 10, 8, 1, 0x1a}; */ | |
77 /* S3 S4 S5 E, smsEnd */ | |
78 /* done by liblineedit.a */ | |
79 /* can be overwritten by ledit_ctrl() */ | |
80 | |
81 typedef enum | |
82 { | |
83 LEDIT_ATCMD_NIL = 0x00, | |
84 LEDIT_ATCMD_AND = 0x26, /* '&' */ | |
85 LEDIT_ATCMD_BASIC = 0x42, /* 'B' */ | |
86 LEDIT_ATCMD_DIAL = 0x44, /* 'D' */ | |
87 LEDIT_ATCMD_EXTENDED = 0x45, /* 'E' */ | |
88 LEDIT_ATCMD_S = 0x53 /* 'S' */ | |
89 } T_LEDIT_ATCMD_MAINTYPE; | |
90 | |
91 typedef enum | |
92 { | |
93 LEDIT_ATCMD_QUERY = 0x51, | |
94 LEDIT_ATCMD_SET = 0x53, /* 'S' */ | |
95 LEDIT_ATCMD_TEST = 0x54 /* 'T' */ | |
96 } T_LEDIT_ATCMD_SUBTYPE; | |
97 | |
98 typedef struct | |
99 { | |
100 T_LEDIT_ATCMD_MAINTYPE mType; | |
101 T_LEDIT_ATCMD_SUBTYPE sType; | |
102 UBYTE append_Flag; | |
103 } T_LEDIT_ATCMD_TYPE; | |
104 | |
105 | |
106 typedef struct | |
107 { | |
108 T_LEDIT_ATCMD_TYPE type; | |
109 char *name; | |
110 char *params; | |
111 } T_LEDIT_ATCMD; | |
112 | |
113 /* | |
114 * taken from ACI.doc, must be removed when including "P_ACI.val" ! | |
115 * #define MAX_CMD_LEN 350 | |
116 */ | |
117 | |
118 /* | |
119 * global echo buffer | |
120 */ | |
121 EXTERN char g_ledit_echoBuf[MAX_CMD_LEN+1]; | |
122 /* | |
123 * public functions | |
124 */ | |
125 EXTERN T_LEDIT_RSLT ledit_cmd (UBYTE src_id, const UBYTE *chars, USHORT len); | |
126 EXTERN T_LEDIT_RSLT ledit_text (UBYTE src_id, const UBYTE *chars, USHORT len); | |
127 EXTERN T_LEDIT_RSLT ledit_get_first (UBYTE src_id, T_LEDIT_ATCMD **cmd); | |
128 EXTERN T_LEDIT_RSLT ledit_get_next (UBYTE src_id, T_LEDIT_ATCMD **cmd); | |
129 EXTERN T_LEDIT_RSLT ledit_get_current(UBYTE src_id, T_LEDIT_ATCMD **cmd); | |
130 EXTERN T_LEDIT_RSLT ledit_get_text (UBYTE src_id, char **txt); | |
131 EXTERN T_LEDIT_RSLT ledit_ctrl (UBYTE src_id, T_LEDIT_CTRL ctrl, T_LEDIT_ERR **err); | |
132 EXTERN T_LEDIT_RSLT ledit_set_config (UBYTE src_id, T_LEDIT line); | |
133 EXTERN T_LEDIT_RSLT ledit_trace_line (UBYTE src_id, char *txt); | |
134 | |
135 #endif |