This commit was manufactured by cvs2svn to create tag
[gnokii.git] / include / protocol / fbus.h
1 /*
2
3   G N O K I I
4
5   A Linux/Unix toolset and driver for Nokia mobile phones.
6
7   Released under the terms of the GNU GPL, see file COPYING for more details.
8
9   Header file for the various functions, definitions etc. used to implement
10   the handset interface.  See fbus-6110.c for more details.
11
12 */
13
14 #ifndef __fbus_h
15 #define __fbus_h
16
17 #include "gsm-api.h"
18
19 /* This byte is at the beginning of all GSM Frames sent over FBUS to Nokia
20    6110 phones. */
21 #define FBUS_FRAME_ID       0x1e
22
23 /* This byte is at the beginning of all GSM Frames sent over infrared to Nokia
24    6110 phones. */
25 #define FBUS_IR_FRAME_ID    0x1c
26
27 #define FBUS_DEVICE_PHONE   0x00 /* Nokia mobile phone. */
28 #define FBUS_DEVICE_PC      0x0c /* Our PC (FBUS). */
29
30 #define FBUS_FRTYPE_ACK     0x7f /* Acknowledge of the received frame. */
31
32 #define FBUS_MAX_TRANSMIT_LENGTH (256)
33 #define FBUS_MAX_RECEIVE_LENGTH  (512)
34 #define FBUS_MAX_CONTENT_LENGTH  (120)
35
36 /* Global variables */
37 extern GSM_Protocol    FBUS_Functions;
38
39 /* States for receive code. */
40
41 enum FBUS_RX_States {
42   FBUS_RX_Sync,
43   FBUS_RX_Discarding,
44   FBUS_RX_GetDestination,
45   FBUS_RX_GetSource,
46   FBUS_RX_GetType,
47   FBUS_RX_GetLength1,
48   FBUS_RX_GetLength2,
49   FBUS_RX_GetMessage
50 };
51
52 GSM_Error FBUS_Initialise(char *port_device, char *initlength,
53                           GSM_ConnectionType connection,
54                           void (*rlp_callback)(RLP_F96Frame *frame));
55
56 int FBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer);
57 int FBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer);
58 void FBUS_Terminate(void);
59 void FBUS_RX_StateMachine(unsigned char rx_byte);
60
61 #endif /* __fbus_h */