8dfdfa956ba99f6346b598a8cc6309a9ed533597
[gnokii.git] / common / gsm-error.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) 2001 Pawe³ Kot <pkot@linuxnews.pl>
10
11   Released under the terms of the GNU GPL, see file COPYING for more details.
12
13   Error codes.
14
15   $Log$
16   Revision 1.1.1.1.2.1  2001/12/14 20:54:44  short
17   Update: orig2001_12_04_22_45 -> orig2001_12_14_20_46
18
19   Revision 1.1.1.2  2001/12/14 19:48:52  short
20   :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Fri Dec 14 20:46 CET 2001
21
22   Revision 1.3  2001/12/14 14:37:41  pkot
23   Cleanups. Call divert support for at and 7110 series
24
25   Revision 1.2  2001/11/08 16:34:19  pkot
26   Updates to work with new libsms
27
28   Revision 1.1  2001/10/24 22:33:01  pkot
29   Moved error codes to a separate files
30
31
32 */
33
34 #include "gsm-error.h"
35
36 char *print_error(GSM_Error e)
37 {
38         switch (e) {
39         case GE_NONE:                     return "No error.";
40         case GE_DEVICEOPENFAILED:         return "Couldn't open specified serial device.";
41         case GE_UNKNOWNMODEL:             return "Model specified isn't known/supported.";
42         case GE_NOLINK:                   return "Couldn't establish link with phone.";
43         case GE_TIMEOUT:                  return "Command timed out.";
44         case GE_TRYAGAIN:                 return "Try again.";
45         case GE_INVALIDSECURITYCODE:      return "Invalid Security code.";
46         case GE_NOTIMPLEMENTED:           return "Called command is not implemented for the used model.";
47         case GE_INVALIDSMSLOCATION:       return "Invalid SMS location.";
48         case GE_INVALIDPHBOOKLOCATION:    return "Invalid phonebook location.";
49         case GE_INVALIDMEMORYTYPE:        return "Invalid type of memory.";
50         case GE_INVALIDSPEEDDIALLOCATION: return "Invalid speed dial location.";
51         case GE_INVALIDCALNOTELOCATION:   return "Invalid calendar note location.";
52         case GE_INVALIDDATETIME:          return "Invalid date, time or alarm specification.";
53         case GE_EMPTYSMSLOCATION:         return "SMS location is empty.";
54         case GE_PHBOOKNAMETOOLONG:        return "Phonebook name is too long.";
55         case GE_PHBOOKNUMBERTOOLONG:      return "Phonebook number is too long.";
56         case GE_PHBOOKWRITEFAILED:        return "Phonebook write failed.";
57         case GE_SMSSENDOK:                return "SMS was send correctly.";
58         case GE_SMSSENDFAILED:            return "SMS send fail.";
59         case GE_SMSWAITING:               return "Waiting for the next part of SMS.";
60         case GE_SMSTOOLONG:               return "SMS message too long.";
61         case GE_SMSWRONGFORMAT:           return "Wrong format of the SMS message.";
62         case GE_NONEWCBRECEIVED:          return "Attempt to read CB when no new CB received";
63         case GE_INTERNALERROR:            return "Problem occured internal to model specific code.";
64         case GE_CANTOPENFILE:             return "Can't open file with bitmap/ringtone";
65         case GE_WRONGNUMBEROFCOLORS:      return "Wrong number of colors in specified bitmap file";
66         case GE_WRONGCOLORS:              return "Wrong colors in bitmap file";
67         case GE_INVALIDFILEFORMAT:        return "Invalid format of file";
68         case GE_SUBFORMATNOTSUPPORTED:    return "Subformat of file not supported";
69         case GE_FILETOOSHORT:             return "Too short file to read";
70         case GE_FILETOOLONG:              return "Too long file to read";
71         case GE_INVALIDIMAGESIZE:         return "Invalid size of bitmap (in file, sms etc.)";
72         case GE_NOTSUPPORTED:             return "Function not supported by the phone";
73         case GE_BUSY:                     return "Command is still being executed.";
74         case GE_USERCANCELED:             return "User has cancelled the action.";   
75         case GE_UNKNOWN:                  return "Unknown error - well better than nothing!!";
76         case GE_MEMORYFULL:               return "Memory is full";
77         case GE_NOTWAITING:               return "Not waiting for a response from the phone";
78         case GE_NOTREADY:                 return "Device not ready.";
79         case GE_LINEBUSY:                 return "Outgoing call requested reported line busy";
80         case GE_NOCARRIER:                return "No Carrier error during data call setup ?";
81         default:                          return "Unknown error.";
82         }
83 }