7 A Linux/Unix toolset and driver for Nokia mobile phones.
9 Copyright (C) 1999, 2000 Hugh Blemings & Pavel JanÃk ml.
11 Released under the terms of the GNU GPL, see file COPYING for more details.
13 The development of RLP protocol is sponsored by SuSE CR, s.r.o. (Pavel use
14 the SIM card from SuSE for testing purposes).
16 This file: rlp-common.h Version 0.3.1
18 Header file for RLP protocol.
21 Revision 1.1.1.4 2002/04/03 00:08:20 short
22 Found in "gnokii-working" directory, some November-patches version
24 Revision 1.2 2001/06/10 11:29:49 machek
25 It is very bad idea to name enum "Data", because it is then impossible
26 to use variable called "Data".
28 Revision 1.1 2001/02/21 19:57:11 chris
29 More fiddling with the directory layout
34 #ifndef __data_rlp_common_h
35 #define __data_rlp_common_h
41 /* Global variables */
47 /* Typedef for frame type - they are the same for RLP version 0, 1 and 2. */
50 RLPFT_X, /* Unknown. */
51 RLPFT_U, /* Unnumbered frame. */
52 RLPFT_S, /* Supervisory frame. */
53 RLPFT_IS /* Information plus Supervisory (I+S) frame. */
56 /* Define the various Unnumbered frame types. Numbering is bit reversed
57 relative to ETSI GSM 04.22 for easy parsing. */
60 RLPU_SABM = 0x07, /* Set Asynchronous Balanced Mode. */
61 RLPU_UA = 0x0c, /* Unnumbered Acknowledge. */
62 RLPU_DISC = 0x08, /* Disconnect. */
63 RLPU_DM = 0x03, /* Disconnected Mode. */
64 RLPU_NULL = 0x0f, /* Null information. */
65 RLPU_UI = 0x00, /* Unnumbered Information. */
66 RLPU_XID = 0x17, /* Exchange Identification. */
67 RLPU_TEST = 0x1c, /* Test. */
68 RLPU_REMAP = 0x11 /* Remap. */
71 /* Define supervisory frame field. */
74 RLPS_RR = 0x00, /* Receive Ready. */
75 RLPS_REJ = 0x02, /* Reject. */
76 RLPS_RNR = 0x01, /* Receive Not Ready. */
77 RLPS_SREJ = 0x03 /* Selective Reject. */
80 /* Used for CurrentFrameType. */
103 /* Frame definition for TCH/F9.6 frame. */
111 /* Header data "split up" for TCH/F9.6 frame. */
114 u8 Ns; /* Send sequence number. */
115 u8 Nr; /* Receive sequence number. */
116 u8 M; /* Unumbered frame type. */
118 bool PF; /* Poll/Final. */
119 bool CR; /* Command/Response. */
120 RLP_FrameType Type; /* Frame type. */
124 /* RLP User requests */
132 } RLP_UserRequestStore;
147 Data, /* FIXME: This should really be called RLP_Data, otherwise it hogs name "Data"! */
152 /* RLP (main) states. See GSM specification 04.22 Annex A, Section A.1.1. */
155 RLP_S0, /* ADM and Detached */
156 RLP_S1, /* ADM and Attached */
157 RLP_S2, /* Pending Connect Request */
158 RLP_S3, /* Pending Connect Indication */
159 RLP_S4, /* ABM and Connection Established */
160 RLP_S5, /* Disconnect Initiated */
161 RLP_S6, /* Pending Reset Request */
162 RLP_S7, /* Pending Reset Indication */
166 /* RLP specification defines several states in which variables can be. */
183 RLP_StateVariable State;
188 /* Prototypes for functions. */
190 void RLP_DisplayF96Frame(RLP_F96Frame *frame);
191 void RLP_DecodeF96Header(RLP_F96Frame *frame, RLP_F96Header *header);
192 void RLP_DisplayXID(u8 *frame);
193 void RLP_Initialise(bool (*rlp_send_function)(RLP_F96Frame *frame, bool out_dtx), int (*rlp_passup)(RLP_UserInds ind, u8 *buffer, int length));
194 void RLP_Init_link_vars(void);
195 void RLP_SetUserRequest(RLP_UserRequests type, bool value);
196 void RLP_Send(char *buffer, int length);
198 #endif /* __data_rlp_common_h */