gnokii-users
[Top][All Lists]
Advanced

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

3110 keepalive cleanup (patch)


From: Osma Suominen
Subject: 3110 keepalive cleanup (patch)
Date: Fri, 14 Feb 2003 22:11:43 +0200 (EET)

Hello,

here's a patch that removes the remaining pieces of keepalive-related
code in the 3110 driver. The keepalive stuff was not functional in any
case (AFAIK it used to work with a different thread, but important parts
of the code were removed long ago), just some static variables were
getting assigned values.

There is no specific keepalive message type for the 3110, rather the old
code used normal status information messages every two seconds, if
nothing else was seen "on the air".

This may still have to be implemented sometime later, but these lines of
code won't be useful in any case so they can as well be removed.

-Osma



Index: common/phones/nk3110.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk3110.c,v
retrieving revision 1.27
diff -u -r1.27 nk3110.c
--- common/phones/nk3110.c      13 Feb 2003 22:42:12 -0000      1.27
+++ common/phones/nk3110.c      14 Feb 2003 19:59:48 -0000
@@ -203,11 +203,6 @@
 static bool SimAvailable = false;
 static int user_data_count = 0;

-/* These are related to keepalive functionality */
-static bool RequestTerminate;
-static bool DisableKeepAlive;
-static int KeepAliveTimer;
-
 /* Initialise is the only function allowed to 'use' state */
 static gn_error P3110_Initialise(struct gn_statemachine *state)
 {
@@ -240,10 +235,6 @@
        gn_data_clear(&data);
        if (sm_block(0x16, &data, state) != GN_ERR_NONE) return GN_ERR_NOTREADY;

-       /* Start sending keepalive messages in separate thread */
-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
-       RequestTerminate = false;
-       DisableKeepAlive = false;
        return GN_ERR_NONE;
 }

@@ -251,7 +242,6 @@
 static gn_error P3110_GetSMSInfo(gn_data *data, struct gn_statemachine *state)
 {
        dprintf("Getting SMS info...\n");
-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
        if (sm_message_send(0, 0x3f, NULL, state) != GN_ERR_NONE) return 
GN_ERR_NOTREADY;
        return sm_block(0x41, data, state);
 }
@@ -259,7 +249,6 @@
 static gn_error P3110_GetPhoneInfo(gn_data *data, struct gn_statemachine 
*state)
 {
        dprintf("Getting phone info...\n");
-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
        if (sm_message_send(0, 0x4c, NULL, state) != GN_ERR_NONE) return 
GN_ERR_NOTREADY;
        return sm_block(0x4d, data, state);
 }
@@ -267,7 +256,6 @@
 static gn_error P3110_GetStatusInfo(gn_data *data, struct gn_statemachine 
*state)
 {
        dprintf("Getting phone status...\n");
-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
        if (sm_message_send(0, 0x4a, NULL, state) != GN_ERR_NONE) return 
GN_ERR_NOTREADY;
        return sm_block(0x4b, data, state);
 }
@@ -295,7 +283,6 @@
 {
        dprintf("Identifying...\n");
        pnok_manufacturer_get(data->manufacturer);
-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
        if (sm_message_send(0, 0x4c, NULL, state) != GN_ERR_NONE) return 
GN_ERR_NOTREADY;
        sm_block(0x4d, data, state);

@@ -313,8 +300,6 @@

        dprintf("Getting SMS message...\n");

-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
-
        if (!data->raw_sms) return GN_ERR_INTERNALERROR;

        /* Set memory type and location in the request */
@@ -385,8 +370,6 @@

        dprintf("Deleting SMS message...\n");

-       KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
-
        /* Set memory type and location in the request */
        memory_type = get_memory_type(data->raw_sms->memory_type);
        if (memory_type == 0) return GN_ERR_INVALIDMEMORYTYPE;
@@ -477,8 +460,6 @@
        retry_count = P3110_SMS_SEND_RETRY_COUNT;

        while (retry_count > 0) {
-               KeepAliveTimer = P3110_KEEPALIVE_TIMEOUT;
-
                if (sm_message_send(hsize, msgtype, hreq, state) != 
GN_ERR_NONE) return GN_ERR_NOTREADY;

                error = sm_block(msgtype, data, state);

Index: include/phones/nk3110.h
===================================================================
RCS file: /cvsroot/gnokii/gnokii/include/phones/nk3110.h,v
retrieving revision 1.5
diff -u -r1.5 nk3110.h
--- include/phones/nk3110.h     28 Mar 2002 21:37:49 -0000      1.5
+++ include/phones/nk3110.h     14 Feb 2003 19:59:48 -0000
@@ -39,9 +39,6 @@
 #define P3110_MEMORY_SIZE_SM 20
 #define P3110_MEMORY_SIZE_ME 0

-/* 2 seconds idle timeout */
-#define P3110_KEEPALIVE_TIMEOUT 20;
-
 /* Number of times to try resending SMS (empirical) */
 #define P3110_SMS_SEND_RETRY_COUNT 4


-- 
*** Osma Suominen *** address@hidden *** http://www.iki.fi/ozone/ ***




reply via email to

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