Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r3501 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
   2. r3502 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
   3. r3503 - trunk/src/target/gsm/src/util ([EMAIL PROTECTED])
--- Begin Message ---
Author: jserv
Date: 2007-11-24 19:52:38 +0100 (Sat, 24 Nov 2007)
New Revision: 3501

Modified:
   trunk/src/target/gsm/src/gsmd/machine_gta01.c
Log:
Indentation with consistent coding style of gsmd.
Remove C++ style comments.


Modified: trunk/src/target/gsm/src/gsmd/machine_gta01.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/machine_gta01.c       2007-11-23 22:31:57 UTC 
(rev 3500)
+++ trunk/src/target/gsm/src/gsmd/machine_gta01.c       2007-11-24 18:52:38 UTC 
(rev 3501)
@@ -33,7 +33,7 @@
 #include <gsmd/machineplugin.h>
 #include <gsmd/atcmd.h>
 
-#define GSMD_MODEM_WAKEUP_TIMEOUT     3
+#define GSMD_MODEM_WAKEUP_TIMEOUT      3
 #define GSMD_MODEM_POWEROFF_TIMEOUT    3        
 
 static void poweroff_timeout(struct gsmd_timer *tmr, void *data) 
@@ -41,35 +41,37 @@
        exit(0);
 }
 
-static struct gsmd_timer * poweroff_timer(struct gsmd *g)
+static struct gsmd_timer *poweroff_timer(struct gsmd *g)
 {
        struct timeval tv;
        tv.tv_sec = GSMD_MODEM_POWEROFF_TIMEOUT;
        tv.tv_usec = 0;
        DEBUGP("Create power off timer\n");
 
-       return gsmd_timer_create(&tv,&poweroff_timeout,g);
+       return gsmd_timer_create(&tv, &poweroff_timeout, g);
 }
 
 static int gta01_power(struct gsmd *g, int power)
 {
-       struct gsmd_atcmd * cmd = NULL;
+       struct gsmd_atcmd *cmd = NULL;
 
-       switch (power) 
-       {
-               case GSMD_MODEM_POWERUP: 
+       switch (power) {
+               case GSMD_MODEM_POWERUP:
                        break;
 
-               case GSMD_MODEM_POWERDOWN:      
+               case GSMD_MODEM_POWERDOWN:
+                       /* After sending "[EMAIL PROTECTED]" to GSM modem, 
modem will
+                        * soon power off, and then gsmd gets no response
+                        * from modem. */
+                       cmd = atcmd_fill("[EMAIL PROTECTED]", 7 + 1, NULL,
+                                       g, 0, poweroff_timer);
 
-                       //After send [EMAIL PROTECTED] to GSM modem, modem will 
not work anymore and gsmd get no response
-                       cmd = atcmd_fill("[EMAIL PROTECTED]", 7+1, NULL, g, 0, 
poweroff_timer);
-
                        if (!cmd)
                                return -ENOMEM;
 
                        llist_add_tail(&cmd->list, &g->pending_atcmds);
-                       if (llist_empty(&g->busy_atcmds) && 
!llist_empty(&g->pending_atcmds)) {
+                       if (llist_empty(&g->busy_atcmds) && 
+                                       !llist_empty(&g->pending_atcmds)) {
                                atcmd_wake_pending_queue(g);
                        }
                        break;
@@ -84,61 +86,66 @@
 static int null_wakeup_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) 
 {
        DEBUGP("The wake up callback!!\n");
-        return 0;
+       return 0;
 }
 
 static void wakeup_timeout(struct gsmd_timer *tmr, void *data) 
 {
-        struct gsmd *g=data;
-        struct gsmd_atcmd *cmd=NULL;
-        DEBUGP("Wakeup time out!!\n");
-        if (!llist_empty(&g->busy_atcmds)) {
-                cmd = llist_entry(g->busy_atcmds.next,struct gsmd_atcmd, list);
-        }
-        if (!cmd) { 
-                DEBUGP("ERROR!! busy_atcmds is NULL\n");
-                return;
-        }
+       struct gsmd *g = data;
+       struct gsmd_atcmd *cmd = NULL;
+       DEBUGP("Wakeup time out!!\n");
+       if (!llist_empty(&g->busy_atcmds)) {
+               cmd = llist_entry(g->busy_atcmds.next, struct gsmd_atcmd, list);
+       }
+       if (!cmd) { 
+               DEBUGP("ERROR!! busy_atcmds is NULL\n");
+               return;
+       }
 
-        if (cmd->timeout != tmr) {
-                DEBUGP("ERROR!! cmd->timeout != tmr\n");
-                return;
-        }
+       if (cmd->timeout != tmr) {
+               DEBUGP("ERROR!! cmd->timeout != tmr\n");
+               return;
+       }
 
-        gsmd_timer_free(cmd->timeout);
-        cmd->timeout = NULL;
+       gsmd_timer_free(cmd->timeout);
+       cmd->timeout = NULL;
 
-        // It's a wakeup command
-        if ( cmd->buf[0]==' ') {
-                llist_del(&cmd->list);
-                talloc_free(cmd);
-                // discard the wakeup command, and pass the real command.
-                if (llist_empty(&g->busy_atcmds) && 
!llist_empty(&g->pending_atcmds)) {
-                        atcmd_wake_pending_queue(g);
-                }
-        } else {
-                DEBUGP("ERROR!! Wakeup timeout and cmd->buf is not wakeup 
command!! %s\n",cmd->buf);
-        }
+       /* It's a wakeup command */
+       if ( cmd->buf[0] == ' ') {
+               llist_del(&cmd->list);
+               talloc_free(cmd);
+               /* discard the wakeup command, and pass the real command. */
+               if (llist_empty(&g->busy_atcmds) &&
+                               !llist_empty(&g->pending_atcmds)) {
+                       atcmd_wake_pending_queue(g);
+               }
+       } else {
+               DEBUGP("ERROR!! Wakeup timeout and "
+                               "cmd->buf is not wakeup command!! %s\n",
+                               cmd->buf);
+       }
 }
 
 static struct gsmd_timer * wakeup_timer(struct gsmd *g)
 {
-        struct timeval tv;
-        tv.tv_sec = GSMD_MODEM_WAKEUP_TIMEOUT;
-        tv.tv_usec = 0;
+       struct timeval tv;
+       tv.tv_sec = GSMD_MODEM_WAKEUP_TIMEOUT;
+       tv.tv_usec = 0;
        DEBUGP("Create wake up timer\n");
 
-        return gsmd_timer_create(&tv,&wakeup_timeout,g);
+       return gsmd_timer_create(&tv, &wakeup_timeout, g);
 }
 
-/// adding a null '\r' before real at command.
+/* adding a null '\r' before real at command. */
 static int atcmd_wakeup_modem(struct gsmd *g) 
 {
        DEBUGP("try to wake up\n");
-       struct gsmd_atcmd * cmd= atcmd_fill(" \r", 2, null_wakeup_cb, g, 0, 
wakeup_timer);
+       struct gsmd_atcmd *cmd = atcmd_fill(" \r", 2, null_wakeup_cb,
+                       g, 0, wakeup_timer);
 
        llist_add_tail(&cmd->list, &g->pending_atcmds);
-       if (llist_empty(&g->busy_atcmds) && !llist_empty(&g->pending_atcmds)) {
+       if (llist_empty(&g->busy_atcmds) &&
+                       !llist_empty(&g->pending_atcmds)) {
                atcmd_wake_pending_queue(g);
        }
 
@@ -153,8 +160,6 @@
 
 static int gta01_init(struct gsmd *g, int fd)
 {
-       int rc;
-
        /*
         * We assume that the GSM chipset can take
         * input immediately, so we don't have to




--- End Message ---
--- Begin Message ---
Author: jserv
Date: 2007-11-24 19:56:26 +0100 (Sat, 24 Nov 2007)
New Revision: 3502

Modified:
   trunk/src/target/gsm/src/gsmd/vendor_ti.c
Log:
Fixlet to dead code in cpmb_detect_cb.


Modified: trunk/src/target/gsm/src/gsmd/vendor_ti.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_ti.c   2007-11-24 18:52:38 UTC (rev 
3501)
+++ trunk/src/target/gsm/src/gsmd/vendor_ti.c   2007-11-24 18:56:26 UTC (rev 
3502)
@@ -231,7 +231,7 @@
                         er->tokens[2].u.string, er->tokens[3].u.numeric);
                 rc = gsmd_simplecmd(g, atcmd_buf);
        } else {
-                rc  -EINVAL;
+                rc = -EINVAL;
        }
 
        talloc_free(er);




--- End Message ---
--- Begin Message ---
Author: jserv
Date: 2007-11-24 20:03:43 +0100 (Sat, 24 Nov 2007)
New Revision: 3503

Modified:
   trunk/src/target/gsm/src/util/libgsmd-tool.c
Log:
Print version number in libgsmd-tool.


Modified: trunk/src/target/gsm/src/util/libgsmd-tool.c
===================================================================
--- trunk/src/target/gsm/src/util/libgsmd-tool.c        2007-11-24 18:56:26 UTC 
(rev 3502)
+++ trunk/src/target/gsm/src/util/libgsmd-tool.c        2007-11-24 19:03:43 UTC 
(rev 3503)
@@ -35,6 +35,8 @@
 #include "shell.h"
 #include "atcmd.h"
 
+#include "../gsmd/gsmd-version.h"
+
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #endif
@@ -89,10 +91,15 @@
                );
 }
 
+static void dump_version(void)
+{
+       printf("Version: " GSMD_VERSION "\n");
+}
+
 int main(int argc, char **argv)
 {
        char *pin = NULL;
-       int rc, i, mode, shellwait = 0;
+       int mode = MODE_NONE, shellwait = 0;
 
        printf("libgsm-tool - (C) 2006-2007 by Harald Welte and OpenMoko, 
Inc.\n"
                "This program is Free Software and has ABSOLUTELY NO 
WARRANTY\n\n");
@@ -108,7 +115,8 @@
                        verbose = 1;
                        break;
                case 'V':
-                       /* FIXME */
+                       dump_version();
+                       exit(0);
                        break;
                case 'h':
                        help();




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to