gnokii-users
[Top][All Lists]
Advanced

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

7110 cleanups


From: Pavel Machek
Subject: 7110 cleanups
Date: Fri, 12 Apr 2002 10:22:03 +0200
User-agent: Mutt/1.3.27i

Hi!


Duplicated code is bad.... Fixed. Okay to commit?
                                                        Pavel

Index: common/phones/nk7110.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk7110.c,v
retrieving revision 1.71
diff -u -u -r1.71 nk7110.c
--- common/phones/nk7110.c      4 Apr 2002 22:35:37 -0000       1.71
+++ common/phones/nk7110.c      12 Apr 2002 08:19:32 -0000
@@ -228,8 +224,11 @@
        case GOP_DeleteCalendarNote:
                return P7110_DeleteCalendarNote(data, state);
        case GOP_GetSMS:
+               dprintf("Getting SMS (validating)...\n");
                return P7110_GetSMS(data, state);
        case GOP_GetSMSnoValidate:
+               dprintf("Getting SMS (without validating)...\n");
+               data->SMSFolder = NULL;
                return P7110_GetSMSnoValidate(data, state);
        case GOP_OnSMS:
                /* Register notify when running for the first time */
@@ -905,7 +904,6 @@
                                0x01, /* Location */
                                0x01, 0x65, 0x01};
 
-       dprintf("Getting SMS (without validating)...\n");
        data->SMSFolder = NULL;
        req[4] = GetMemoryType(data->SMSMessage->MemoryType);
        req[5] = (data->SMSMessage->Number & 0xff00) >> 8;
@@ -914,15 +912,8 @@
        return SM_Block(state, data, 0x14);
 }
 
-
-
 static GSM_Error P7110_GetSMS(GSM_Data *data, GSM_Statemachine *state)
 {
-       unsigned char req[] = {FBUS_FRAME_HEADER, 0x07,
-                               0x08, /* FolderID */
-                               0x00,
-                               0x01, /* Location */
-                               0x01, 0x65, 0x01};
        GSM_Error error;
 
        /* Handle MemoryType = 0 explicitely, because SMSFolder->FolderID = 0 
by default */
@@ -950,13 +941,7 @@
                data->SMSMessage->Number = 
data->SMSFolder->locations[data->SMSMessage->Number - 1];
        }
 
-
-       dprintf("Getting SMS (validating)...\n");
-       req[4] = GetMemoryType(data->SMSMessage->MemoryType);
-       req[5] = (data->SMSMessage->Number & 0xff00) >> 8;
-       req[6] = data->SMSMessage->Number & 0x00ff;
-       if (SM_SendMessage(state, 10, 0x14, req) != GE_NONE) return GE_NOTREADY;
-       return SM_Block(state, data, 0x14);
+       return P7110_GetSMSnoValidate(data, state);
 }
 
 

-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.



reply via email to

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