:pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
[gnokii.git] / include / links / fbus-phonet.h
1 /*
2
3   $Id$
4
5   G N O K I I
6
7   A Linux/Unix toolset and driver for Nokia mobile phones.
8
9   Copyright (C) 2000 Hugh Blemings & Pavel Janík ml.
10   Copyright (C) 2000 Chris Kemp
11
12   Released under the terms of the GNU GPL, see file COPYING for more details.
13
14   This file provides an API for accessing functions via fbus over irda. 
15   See README for more details on supported mobile phones.
16
17   The various routines are called PHONET_(whatever).
18
19   $Log$
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
22
23   Revision 1.2  2001/03/21 23:36:07  chris
24   Added the statemachine
25   This will break gnokii --identify and --monitor except for 6210/7110
26
27   Revision 1.1  2001/02/21 19:57:12  chris
28   More fiddling with the directory layout
29
30   Revision 1.1  2001/02/06 21:15:37  chris
31   Preliminary irda support for 7110 etc.  Not well tested!
32
33
34 */
35
36 #ifndef __links_fbus_phonet_h
37 #define __links_fbus_phonet_h
38
39
40 #define PHONET_MAX_FRAME_LENGTH    1010
41 #define PHONET_MAX_TRANSMIT_LENGTH 1010
42 #define PHONET_MAX_CONTENT_LENGTH  1000
43
44
45 /* This byte is at the beginning of all GSM Frames sent over PhoNet. */
46 #define FBUS_PHONET_FRAME_ID 0x14
47
48
49 GSM_Error PHONET_Initialise(GSM_Link *newlink, GSM_Statemachine *state);
50
51
52 #ifdef __links_fbus_phonet_c  /* Prototype functions for fbus-phonet.c only */
53
54 typedef struct{
55   int BufferCount;
56   enum FBUS_RX_States state;
57   int MessageSource;
58   int MessageDestination;
59   int MessageType;
60   int MessageLength;
61   char MessageBuffer[PHONET_MAX_FRAME_LENGTH];
62 } PHONET_IncomingMessage;
63
64
65 bool PHONET_OpenSerial();
66 void PHONET_RX_StateMachine(unsigned char rx_byte);
67 int PHONET_TX_SendFrame(u8 message_length, u8 message_type, u8 *buffer);
68 GSM_Error PHONET_SendMessage(u16 messagesize, u8 messagetype, void *message);
69 int PHONET_TX_SendAck(u8 message_type, u8 message_seq);
70
71 #endif   /* #ifdef __links_fbus_phonet_c */
72
73 #endif   /* #ifndef __links_fbus_phonet_h */