7 A Linux/Unix toolset and driver for Nokia mobile phones.
9 Copyright (C) 2000 Hugh Blemings & Pavel JanÃk ml.
10 Copyright (C) 2000 Chris Kemp
12 Released under the terms of the GNU GPL, see file COPYING for more details.
14 This file provides an API for accessing functions via fbus.
15 See README for more details on supported mobile phones.
17 The various routines are called FBUS_(whatever).
20 Revision 1.1.1.2 2002/04/03 00:08:20 short
21 Found in "gnokii-working" directory, some November-patches version
23 Revision 1.4 2001/03/21 23:36:08 chris
24 Added the statemachine
25 This will break gnokii --identify and --monitor except for 6210/7110
27 Revision 1.3 2001/03/19 23:44:57 pkot
30 Revision 1.2 2001/03/13 01:23:19 pkot
31 Windows updates (Manfred Jonsson)
33 Revision 1.1 2001/02/21 19:57:12 chris
34 More fiddling with the directory layout
36 Revision 1.3 2001/02/06 21:15:36 chris
37 Preliminary irda support for 7110 etc. Not well tested!
39 Revision 1.2 2001/01/17 02:54:55 chris
40 More 7110 work. Use with care! (eg it is not possible to delete phonebook entries)
41 I can now edit my phonebook in xgnokii but it is 'work in progress'.
43 Revision 1.1 2001/01/14 22:47:01 chris
44 Preliminary 7110 support (dlr9 only) and the beginnings of a new structure
49 #ifndef __links_fbus_h
50 #define __links_fbus_h
53 #include "gsm-statemachine.h"
56 #include <sys/types.h>
57 #include <sys/timeb.h>
60 #define FBUS_MAX_FRAME_LENGTH 256
61 #define FBUS_MAX_MESSAGE_TYPES 128
62 #define FBUS_MAX_TRANSMIT_LENGTH 256
63 #define FBUS_MAX_CONTENT_LENGTH 120
65 /* Nokia mobile phone. */
66 #define FBUS_DEVICE_PHONE 0x00
69 #define FBUS_DEVICE_PC 0x0c
72 /* This byte is at the beginning of all GSM Frames sent over FBUS to Nokia
73 phones. This may have to become a phone dependant parameter... */
74 #define FBUS_FRAME_ID 0x1e
76 /* This byte is at the beginning of all GSM Frames sent over IR to Nokia phones. */
77 #define FBUS_IR_FRAME_ID 0x1c
80 /* Every (well, almost every) frame from the computer starts with this
83 #define FBUS_FRAME_HEADER 0x00, 0x01, 0x00
86 /* States for receive code. */
91 FBUS_RX_GetDestination,
104 struct timeval time_now;
105 struct timeval time_last;
107 struct _timeb time_now;
108 struct _timeb time_last;
110 enum FBUS_RX_States state;
112 int MessageDestination;
115 char MessageBuffer[FBUS_MAX_FRAME_LENGTH];
116 } FBUS_IncomingFrame;
120 unsigned char *MessageBuffer;
123 } FBUS_IncomingMessage;
129 } FBUS_OutgoingMessage;
133 FBUS_IncomingFrame i;
134 FBUS_IncomingMessage messages[FBUS_MAX_MESSAGE_TYPES];
135 u8 RequestSequenceNumber;
138 GSM_Error FBUS_Initialise(GSM_Link *newlink, GSM_Statemachine *state);
142 #ifdef __links_fbus_c /* Prototype functions for fbus-generic.c only */
144 bool FBUS_OpenSerial(bool dlr3);
145 void FBUS_RX_StateMachine(unsigned char rx_byte);
146 int FBUS_TX_SendFrame(u8 message_length, u8 message_type, u8 *buffer);
147 GSM_Error FBUS_SendMessage(u16 messagesize, u8 messagetype, void *message);
148 int FBUS_TX_SendAck(u8 message_type, u8 message_seq);
150 #endif /* #ifdef __links_fbus_c */
152 #endif /* #ifndef __links_fbus_h */