comparison src/g23m-aci/aci/line_edit.h @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
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 typedef enum
41 {
42 LEDIT_ERR_NONE = -1,
43 /*000*/ LEDIT_ERR_NoMemory ,
44 /*001*/ LEDIT_ERR_NoMaintenance,
45 /*002*/ LEDIT_ERR_NoValidCommand,
46 /*003*/ LEDIT_ERR_LastCmdPending,
47 /*004*/ LEDIT_ERR_Unknown
48 } T_LEDIT_ERR_CODE;
49
50 typedef struct /* error code - error message mapping */
51 {
52 CHAR* msg; /* error message */
53 T_LEDIT_ERR_CODE code; /* error code */
54 } T_LEDIT_ERR;
55
56
57 typedef enum
58 {
59 LEDIT_CTRL_ERROR,
60 LEDIT_CTRL_CMPL,
61 LEDIT_CTRL_REMOVE_SRC,
62 LEDIT_CTRL_PROMPT,
63 LEDIT_CTRL_CRLF_PROMPT,
64 LEDIT_CTRL_MORE_CMDS
65 } T_LEDIT_CTRL;
66
67
68 typedef struct
69 {
70 UBYTE S3; /* CR */
71 UBYTE S4; /* LF */
72 UBYTE S5; /* BS */
73 UBYTE atE; /* Command Echo: ON */
74 UBYTE smsEnd;/* want to be non V25.ter conform */
75 } T_LEDIT; /* initial = {13, 10, 8, 1, 0x1a}; */
76 /* S3 S4 S5 E, smsEnd */
77 /* done by liblineedit.a */
78 /* can be overwritten by ledit_ctrl() */
79
80 typedef enum
81 {
82 LEDIT_ATCMD_NIL = 0x00,
83 LEDIT_ATCMD_AND = 0x26, /* '&' */
84 LEDIT_ATCMD_BASIC = 0x42, /* 'B' */
85 LEDIT_ATCMD_DIAL = 0x44, /* 'D' */
86 LEDIT_ATCMD_EXTENDED = 0x45, /* 'E' */
87 LEDIT_ATCMD_S = 0x53 /* 'S' */
88 } T_LEDIT_ATCMD_MAINTYPE;
89
90 typedef enum
91 {
92 LEDIT_ATCMD_QUERY = 0x51,
93 LEDIT_ATCMD_SET = 0x53, /* 'S' */
94 LEDIT_ATCMD_TEST = 0x54 /* 'T' */
95 } T_LEDIT_ATCMD_SUBTYPE;
96
97 typedef struct
98 {
99 T_LEDIT_ATCMD_MAINTYPE mType;
100 T_LEDIT_ATCMD_SUBTYPE sType;
101 UBYTE append_Flag;
102 } T_LEDIT_ATCMD_TYPE;
103
104
105 typedef struct
106 {
107 T_LEDIT_ATCMD_TYPE type;
108 char *name;
109 char *params;
110 } T_LEDIT_ATCMD;
111
112 /*
113 * taken from ACI.doc, must be removed when including "P_ACI.val" !
114 * #define MAX_CMD_LEN 350
115 */
116
117 /*
118 * global echo buffer
119 */
120 EXTERN char g_ledit_echoBuf[MAX_CMD_LEN+1];
121 /*
122 * public functions
123 */
124 EXTERN T_LEDIT_RSLT ledit_cmd (UBYTE src_id, const UBYTE *chars, USHORT len);
125 EXTERN T_LEDIT_RSLT ledit_text (UBYTE src_id, const UBYTE *chars, USHORT len);
126 EXTERN T_LEDIT_RSLT ledit_get_first (UBYTE src_id, T_LEDIT_ATCMD **cmd);
127 EXTERN T_LEDIT_RSLT ledit_get_next (UBYTE src_id, T_LEDIT_ATCMD **cmd);
128 EXTERN T_LEDIT_RSLT ledit_get_current(UBYTE src_id, T_LEDIT_ATCMD **cmd);
129 EXTERN T_LEDIT_RSLT ledit_get_text (UBYTE src_id, char **txt);
130 EXTERN T_LEDIT_RSLT ledit_ctrl (UBYTE src_id, T_LEDIT_CTRL ctrl, T_LEDIT_ERR **err);
131 EXTERN T_LEDIT_RSLT ledit_set_config (UBYTE src_id, T_LEDIT line);
132 EXTERN T_LEDIT_RSLT ledit_trace_line (UBYTE src_id, char *txt);
133
134 #endif