:pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
[gnokii.git] / common / phones / generic.c
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   Copytight (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 useful functions for all phones  
15   See README for more details on supported mobile phones.
16
17   The various routines are called PGEN_(whatever).
18
19   $Log$
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
22
23   Revision 1.5  2001/09/14 12:15:28  pkot
24   Cleanups from 0.3.3 (part1)
25
26   Revision 1.4  2001/03/23 13:40:24  chris
27   Pavel's patch and a few fixes.
28
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
32
33   Revision 1.2  2001/03/06 10:39:35  machek
34   Function for printing unknown packets can probably be shared across
35   all phones.
36
37   Revision 1.1  2001/02/21 19:57:07  chris
38   More fiddling with the directory layout
39
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
46
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)
50
51   Revision 1.3  2001/01/29 17:14:42  chris
52   dprintf now in misc.h (and fiddling with 7110 code)
53
54   Revision 1.2  2001/01/23 15:32:42  chris
55   Pavel's 'break' and 'static' corrections.
56   Work on logos for 7110.
57
58   Revision 1.1  2001/01/14 22:46:59  chris
59   Preliminary 7110 support (dlr9 only) and the beginnings of a new structure
60
61
62 */
63
64 #include <stdlib.h>
65 #include <string.h>
66 #include <ctype.h>
67
68 #include "gsm-common.h"
69 #include "phones/generic.h"
70 #include "misc.h"
71
72 /* Useful debug function */
73 GSM_Error PGEN_DebugMessage(int type, unsigned char *mes, int len)
74 {
75         int i;
76   
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]);
81         dprintf("\n");
82
83         return GE_NONE;
84 }
85
86
87 /* If we do not support a message type, print out some debugging info */
88
89 GSM_Error PGEN_IncomingDefault(int messagetype, unsigned char *buffer, int length)
90 {
91         dprintf("Unknown Message received [type (%02x) length (%d): \n", messagetype, length);
92         PGEN_DebugMessage(messagetype, buffer, length);
93
94         return GE_NONE;
95 }