summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/protocol/alcatel/alcabus.h
Unidiff
Diffstat (limited to 'gammu/emb/common/protocol/alcatel/alcabus.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/protocol/alcatel/alcabus.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/gammu/emb/common/protocol/alcatel/alcabus.h b/gammu/emb/common/protocol/alcatel/alcabus.h
new file mode 100644
index 0000000..3b9b44e
--- a/dev/null
+++ b/gammu/emb/common/protocol/alcatel/alcabus.h
@@ -0,0 +1,61 @@
1/* (c) 2002-2003 by Michal Cihar */
2/*
3 * Low level functions for communication with Alcatel One Touch phones.
4 *
5 * This code implements the protocol used for synchronisation with PC.
6 */
7
8#ifndef alcabus_h
9#define alcabus_h
10
11#include "../protocol.h"
12
13 #define ALCATEL_HEADER 0x7E
14
15/* packet types: */
16/* used for starting binary connection (must be preceeded by
17 * AT+CPROT=16,"V1.0",16 and phone should response to it by CONNECT_ACK)
18 */
19 #define ALCATEL_CONNECT 0x0A
20/* received when connect suceeded */
21 #define ALCATEL_CONNECT_ACK 0x0C
22/* used for stopping binary connection */
23 #define ALCATEL_DISCONNECT 0x0D
24/* received when binnary connection ends */
25 #define ALCATEL_DISCONNECT_ACK 0x0E
26/* some control ack, I really don't know what should it do, so currently it
27 * is just ignored. It comes time to time, and communication continues OK also
28 * if no reply was made. */
29 #define ALCATEL_CONTROL 0x0F
30/* sending/recieving data */
31 #define ALCATEL_DATA 0x02
32/* acknowledge to data */
33 #define ALCATEL_ACK 0x06
34
35/* Maximal value for packet counter */
36 #define ALCATEL_MAX_COUNTER 0x3D
37
38typedef struct {
39 GSM_Protocol_Message Msg;
40 /* Incoming packets ID counter */
41 int in_counter;
42 /* Outgoing packets ID counter */
43 int out_counter;
44 /* Expected size of incoming packet */
45 int expected_size;
46 /* What is type of frame we expect next */
47 unsigned char next_frame;
48 /* State of mobile, if we expect something (generally some ack) we set
49 * this to true and no other action can be performed until it is false. */
50 bool busy;
51} GSM_Protocol_ALCABUSData;
52
53#ifndef GSM_USED_SERIALDEVICE
54# define GSM_USED_SERIALDEVICE
55#endif
56
57#endif
58
59/* How should editor hadle tabs in this file? Add editor commands here.
60 * vim: noexpandtab sw=8 ts=8 sts=8:
61 */