gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maybe wrong model length for 6610?


From: Holger Kiskowski
Subject: Re: Maybe wrong model length for 6610?
Date: Sun, 28 Nov 2004 10:57:53 +0000 (UTC)
User-agent: slrn/0.9.7.4 (Linux)

On Sat, 27 Nov 2004 Pawel Kot <address@hidden> wrote:
[debug output]
>> Sorry, this function is known to break your phone (Nokia 6100). Refusing to
>> do it. [...]

> No. That's what phone sends. Anyway, the comment is wrong (Nokia 6100
> is hardcoded there).

This patch makes the error output for the  irda blacklist printing the
actual model name.

This is my first attempt to do something useful to the gnokii source, so
apologies in advance. If you don't like it, just throw it in the bin.  :-)

Holger

diff -ur gnokii-0.6.4/common/phones/nk6510.c 
gnokii-0.6.4-patched/common/phones/nk6510.c
--- gnokii-0.6.4/common/phones/nk6510.c Sun Oct 17 21:44:21 2004
+++ gnokii-0.6.4-patched/common/phones/nk6510.c Sun Nov 28 10:51:29 2004
@@ -399,14 +399,18 @@
        bool connected = false;
        unsigned int attempt = 0;
        int i;
-       char *irda_blacklist[] = {"NPL-2",      /* 6100 */
-                                 "RM-37",      /* 6610i */
-                                 "NHL-4",      /* 7210 */
-                                 "NHL-4J",     /* 7250 -- I'm not sure, but 
don't risk it -- bozo */
-                                 "NHL-4JX",    /* 7250i */
-                                 "NPM-6",      /* 5100 */
-                                 "NPM-6X",     /* 5100 */
-                                 NULL};
+       struct {
+               const char *model, *name;
+       } const irda_blacklist[] = {
+               {"NPL-2", "6100"},
+               {"RM-37", "6610i"},
+               {"NHL-4", "6610 / 7210"},
+               {"NHL-4J", "7250"}, /* -- I'm not sure, but don't risk it -- 
bozo */
+               {"NHL-4JX", "7250i"},
+               {"NPM-6", "5100"},
+               {"NPM-6X", "5100"},
+               {NULL, NULL}
+       };
 
        /* Copy in the phone info */
        memcpy(&(state->driver), &driver_nokia_6510, sizeof(gn_driver));
@@ -475,12 +479,12 @@
                /* Refuse to work on 6100 only on Linux with IrDA connection */
 #ifdef __linux__
                if (state->config.connection_type == GN_CT_Irda || 
state->config.connection_type == GN_CT_Infrared) {
-                       for (i = 0; irda_blacklist[i]; i++) {
-                               if (!strcmp(data.model, irda_blacklist[i])) {
-                                       fprintf(stderr, _("Sorry, this function 
is known to break your phone (Nokia 6100). Refusing to\n"
+                       for (i = 0; irda_blacklist[i].model; i++) {
+                               if (!strcmp(data.model, 
irda_blacklist[i].model)) {
+                                       fprintf(stderr, _("Sorry, this function 
is known to break your phone (Nokia %s). Refusing to\n"
                                                          "do it. You may try 
to use AT driver. If you are brave enough to test the\n"
                                                          "driver anyway, 
please contact developers at address@hidden"
-                                                         "See also 
http://thread.gmane.org/gmane.linux.drivers.gnokii/3195";));
+                                                         "See also 
http://thread.gmane.org/gmane.linux.drivers.gnokii/3195";), 
irda_blacklist[i].name);
                                        return GN_ERR_NOTIMPLEMENTED;
                                }
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]