7 A Linux/Unix toolset and driver for Nokia mobile phones.
9 Copyright (C) 2000 Hugh Blemings & Pavel JanÃk ml.
10 Copytight (C) 2000 Chris Kemp
12 Released under the terms of the GNU GPL, see file COPYING for more details.
14 This file provides useful functions for all phones
15 See README for more details on supported mobile phones.
17 The various routines are called PGEN_(whatever).
20 Revision 1.1.1.1 2001/11/25 21:59:11 short
21 :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
23 Revision 1.5 2001/09/14 12:15:28 pkot
24 Cleanups from 0.3.3 (part1)
26 Revision 1.4 2001/03/23 13:40:24 chris
27 Pavel's patch and a few fixes.
29 Revision 1.3 2001/03/21 23:36:05 chris
30 Added the statemachine
31 This will break gnokii --identify and --monitor except for 6210/7110
33 Revision 1.2 2001/03/06 10:39:35 machek
34 Function for printing unknown packets can probably be shared across
37 Revision 1.1 2001/02/21 19:57:07 chris
38 More fiddling with the directory layout
40 Revision 1.1 2001/02/16 14:29:53 chris
41 Restructure of common/. Fixed a problem in fbus-phonet.c
42 Lots of dprintfs for Marcin
43 Any size xpm can now be loaded (eg for 7110 startup logos)
44 nk7110 code detects 7110/6210 and alters startup logo size to suit
45 Moved Marcin's extended phonebook code into gnokii.c
47 Revision 1.4 2001/02/03 23:56:17 chris
48 Start of work on irda support (now we just need fbus-irda.c!)
49 Proper unicode support in 7110 code (from pkot)
51 Revision 1.3 2001/01/29 17:14:42 chris
52 dprintf now in misc.h (and fiddling with 7110 code)
54 Revision 1.2 2001/01/23 15:32:42 chris
55 Pavel's 'break' and 'static' corrections.
56 Work on logos for 7110.
58 Revision 1.1 2001/01/14 22:46:59 chris
59 Preliminary 7110 support (dlr9 only) and the beginnings of a new structure
68 #include "gsm-common.h"
69 #include "phones/generic.h"
72 /* Useful debug function */
73 GSM_Error PGEN_DebugMessage(int type, unsigned char *mes, int len)
77 dprintf("Message debug (type %02x):\n", type);
78 for (i = 0; i < len; i++)
79 if (isprint(mes[i])) dprintf("[%02x%c]", mes[i], mes[i]);
80 else dprintf("[%02x ]", mes[i]);
87 /* If we do not support a message type, print out some debugging info */
89 GSM_Error PGEN_IncomingDefault(int messagetype, unsigned char *buffer, int length)
91 dprintf("Unknown Message received [type (%02x) length (%d): \n", messagetype, length);
92 PGEN_DebugMessage(messagetype, buffer, length);