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.1 2001/11/25 21:59:22 short
21 :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
23 Revision 1.5 2001/11/15 12:04:06 pkot
24 Faster initialization for 6100 series (don't check for dlr3 cable)
26 Revision 1.4 2001/03/21 23:36:08 chris
27 Added the statemachine
28 This will break gnokii --identify and --monitor except for 6210/7110
30 Revision 1.3 2001/03/19 23:44:57 pkot
33 Revision 1.2 2001/03/13 01:23:19 pkot
34 Windows updates (Manfred Jonsson)
36 Revision 1.1 2001/02/21 19:57:12 chris
37 More fiddling with the directory layout
39 Revision 1.3 2001/02/06 21:15:36 chris
40 Preliminary irda support for 7110 etc. Not well tested!
42 Revision 1.2 2001/01/17 02:54:55 chris
43 More 7110 work. Use with care! (eg it is not possible to delete phonebook entries)
44 I can now edit my phonebook in xgnokii but it is 'work in progress'.
46 Revision 1.1 2001/01/14 22:47:01 chris
47 Preliminary 7110 support (dlr9 only) and the beginnings of a new structure
52 #ifndef __links_fbus_h
53 #define __links_fbus_h
56 #include "gsm-statemachine.h"
59 #include <sys/types.h>
60 #include <sys/timeb.h>
63 #define FBUS_MAX_FRAME_LENGTH 256
64 #define FBUS_MAX_MESSAGE_TYPES 128
65 #define FBUS_MAX_TRANSMIT_LENGTH 256
66 #define FBUS_MAX_CONTENT_LENGTH 120
68 /* Nokia mobile phone. */
69 #define FBUS_DEVICE_PHONE 0x00
72 #define FBUS_DEVICE_PC 0x0c
75 /* This byte is at the beginning of all GSM Frames sent over FBUS to Nokia
76 phones. This may have to become a phone dependant parameter... */
77 #define FBUS_FRAME_ID 0x1e
79 /* This byte is at the beginning of all GSM Frames sent over IR to Nokia phones. */
80 #define FBUS_IR_FRAME_ID 0x1c
83 /* Every (well, almost every) frame from the computer starts with this
86 #define FBUS_FRAME_HEADER 0x00, 0x01, 0x00
89 /* States for receive code. */
94 FBUS_RX_GetDestination,
107 struct timeval time_now;
108 struct timeval time_last;
110 struct _timeb time_now;
111 struct _timeb time_last;
113 enum FBUS_RX_States state;
115 int MessageDestination;
118 char MessageBuffer[FBUS_MAX_FRAME_LENGTH];
119 } FBUS_IncomingFrame;
123 unsigned char *MessageBuffer;
126 } FBUS_IncomingMessage;
132 } FBUS_OutgoingMessage;
136 FBUS_IncomingFrame i;
137 FBUS_IncomingMessage messages[FBUS_MAX_MESSAGE_TYPES];
138 u8 RequestSequenceNumber;
141 GSM_Error FBUS_Initialise(GSM_Link *newlink, GSM_Statemachine *state, int type);
144 #ifdef __links_fbus_c /* Prototype functions for fbus-generic.c only */
146 bool FBUS_OpenSerial(bool dlr3);
147 void FBUS_RX_StateMachine(unsigned char rx_byte);
148 int FBUS_TX_SendFrame(u8 message_length, u8 message_type, u8 *buffer);
149 GSM_Error FBUS_SendMessage(u16 messagesize, u8 messagetype, void *message);
150 int FBUS_TX_SendAck(u8 message_type, u8 message_seq);
152 #endif /* #ifdef __links_fbus_c */
154 #endif /* #ifndef __links_fbus_h */