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. r2575 - in
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm: .
src ([EMAIL PROTECTED])
2. r2576 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
3. r2577 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
4. r2578 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
5. r2579 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
6. r2580 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
7. r2581 - in trunk/src/target/gsm: include/gsmd src/gsmd
([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-07-31 00:59:08 +0200 (Tue, 31 Jul 2007)
New Revision: 2575
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
openmoko-panel-gsm: catch up with libmokogsmd2
Modified: trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog
2007-07-30 19:10:32 UTC (rev 2574)
+++ trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog
2007-07-30 22:59:08 UTC (rev 2575)
@@ -1,3 +1,8 @@
+2007-07-31 Michael Lauer <[EMAIL PROTECTED]>
+
+ * src/openmoko-panel-gsm.c:
+ Catch up with libmokogsmd2
+
2007-07-30 Michael Lauer <[EMAIL PROTECTED]>
* configure.ac:
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-07-30 19:10:32 UTC (rev 2574)
+++
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-07-30 22:59:08 UTC (rev 2575)
@@ -14,7 +14,7 @@
*
* Current Version: $Rev$ ($Date$) [$Author: mickey $]
*/
-#include <libmokogsmd/moko-gsmd-connection.h>
+#include <libmokogsmd2/moko-gsmd-connection.h>
#include <libmokopanelui2/moko-panel-applet.h>
#include <gtk/gtkimage.h>
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-07-31 08:29:54 +0200 (Tue, 31 Jul 2007)
New Revision: 2576
Modified:
trunk/src/target/gsm/src/gsmd/gsmd.c
Log:
Add higher baudrates: 230k, 460k, 921k (Alex Osborne)
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-30 22:59:08 UTC (rev
2575)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 06:29:54 UTC (rev
2576)
@@ -258,6 +258,9 @@
{ 38400, B38400 },
{ 57600, B57600 },
{ 115200, B115200 },
+ { 230400, B230400 },
+ { 460800, B460800 },
+ { 921600, B921600 },
};
static int set_baudrate(int fd, int baudrate, int hwflow)
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-07-31 09:01:29 +0200 (Tue, 31 Jul 2007)
New Revision: 2577
Modified:
trunk/src/target/gsm/src/gsmd/usock.c
Log:
Use ATH instead of ATH0 for QC compatibility (Philipp Zabel)
Modified: trunk/src/target/gsm/src/gsmd/usock.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/usock.c 2007-07-31 06:29:54 UTC (rev
2576)
+++ trunk/src/target/gsm/src/gsmd/usock.c 2007-07-31 07:01:29 UTC (rev
2577)
@@ -133,7 +133,8 @@
/* FIXME: number type! */
break;
case GSMD_VOICECALL_HANGUP:
- cmd = atcmd_fill("ATH0", 5, &usock_cmd_cb, gu, gph->id);
+ /* ATH0 is not supported by QC, we hope ATH is supported by
everone */
+ cmd = atcmd_fill("ATH", 5, &usock_cmd_cb, gu, gph->id);
break;
case GSMD_VOICECALL_ANSWER:
cmd = atcmd_fill("ATA", 4, &usock_cmd_cb, gu, gph->id);
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-07-31 09:07:24 +0200 (Tue, 31 Jul 2007)
New Revision: 2578
Modified:
trunk/src/target/gsm/src/gsmd/atcmd.c
trunk/src/target/gsm/src/gsmd/gsmd.c
Log:
the latest gsmd sends the alive detector's ATE0 to the GSM modem, even
if interpreter_ready == 0. The attached patch sees to it that if
interpreter_ready is zero, gsmd_alive_start is only called once the
"AT-Command Interpreter ready" message was seen. (Philipp Zabel)
Modified: trunk/src/target/gsm/src/gsmd/atcmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/atcmd.c 2007-07-31 07:01:29 UTC (rev
2577)
+++ trunk/src/target/gsm/src/gsmd/atcmd.c 2007-07-31 07:07:24 UTC (rev
2578)
@@ -185,6 +185,7 @@
!strcmp(buf, "AT-Command Interpreter ready")) {
g->interpreter_ready = 1;
gsmd_initsettings(g);
+ gmsd_alive_start(g);
return 0;
}
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 07:01:29 UTC (rev
2577)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 07:07:24 UTC (rev
2578)
@@ -128,7 +128,7 @@
gsmd_timer_register(tmr);
}
-static int gmsd_alive_start(struct gsmd *gsmd)
+int gmsd_alive_start(struct gsmd *gsmd)
{
struct timeval tv;
@@ -472,10 +472,11 @@
/* select a vendor plugin */
gsmd_vendor_plugin_find(&g);
- if (g.interpreter_ready)
+ if (g.interpreter_ready) {
gsmd_initsettings(&g);
- gmsd_alive_start(&g);
+ gmsd_alive_start(&g);
+ }
gsmd_opname_init(&g);
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-07-31 09:11:08 +0200 (Tue, 31 Jul 2007)
New Revision: 2579
Modified:
trunk/src/target/gsm/src/gsmd/gsmd.c
Log:
don't power off the phone at gsmd startup.
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 07:07:24 UTC (rev
2578)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 07:11:08 UTC (rev
2579)
@@ -178,8 +178,6 @@
rc |= gsmd_simplecmd(gsmd, "AT+CLIP=1");
/* use +COLP: to indicate COLP */
rc |= gsmd_simplecmd(gsmd, "AT+COLP=1");
- /* power off the phone */
- rc |= gsmd_simplecmd(gsmd, "AT+CFUN=0");
/* configure message format as PDU mode*/
/* FIXME: TEXT mode support!! */
rc |= gsmd_simplecmd(gsmd, "AT+CMGF=0");
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-07-31 09:29:00 +0200 (Tue, 31 Jul 2007)
New Revision: 2580
Modified:
trunk/src/target/gsm/src/gsmd/gsmd.c
trunk/src/target/gsm/src/gsmd/vendor_qc.c
Log:
in some cases the Qualcomm chip in the HTC Universal switches to V0 mode
behind our backs. We need support for "0" instead of "OK" in the
synchronous initial command and in the alive check. Note that this
nearly duplicates the "OK" check in atcmd.c. (Philip Zabel)
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 07:11:08 UTC (rev
2579)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2007-07-31 07:29:00 UTC (rev
2580)
@@ -62,7 +62,8 @@
{
struct gsmd_alive_priv *alp = ctx;
- if (!strcmp(resp, "OK"))
+ if (!strcmp(resp, "OK") ||
+ ((alp->gsmd->flags & GSMD_FLAG_V0) && resp[0] == '0'))
alp->alive_responded = 1;
return 0;
}
@@ -199,7 +200,8 @@
{
struct gsmd *gsmd = ctx;
- if (strcmp(resp, "OK")) {
+ if (strcmp(resp, "OK") &&
+ (!(gsmd->flags & GSMD_FLAG_V0) || resp[0] != '0')) {
gsmd_log(GSMD_FATAL, "response '%s' to initial command
invalid", resp);
exit(5);
}
Modified: trunk/src/target/gsm/src/gsmd/vendor_qc.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_qc.c 2007-07-31 07:11:08 UTC (rev
2579)
+++ trunk/src/target/gsm/src/gsmd/vendor_qc.c 2007-07-31 07:29:00 UTC (rev
2580)
@@ -81,6 +81,9 @@
{
/* FIXME: do actual detection of vendor if we have multiple vendors */
/* open /proc/cpuinfo and check for HTC Universal? */
+
+ /* The Qualcomm chip switches to V0 mode in the strangest places */
+ g->flags |= GSMD_FLAG_V0;
return 1;
}
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-07-31 09:38:23 +0200 (Tue, 31 Jul 2007)
New Revision: 2581
Modified:
trunk/src/target/gsm/include/gsmd/gsmd.h
trunk/src/target/gsm/src/gsmd/atcmd.c
Log:
Add '2nd try' of the multiline parser:
Every extended response causes a flush of the previous mlbuf and starts
collecting new response lines. Also, final_cb is now really only reached for
final responses and the code for case 'A' won't overwrite the command buffer
with the response anymore. I throw in '\n' as a separator for multi-line
responses, and the callback is called for each response this way.
(Philipp Zabel)
Modified: trunk/src/target/gsm/include/gsmd/gsmd.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/gsmd.h 2007-07-31 07:29:00 UTC (rev
2580)
+++ trunk/src/target/gsm/include/gsmd/gsmd.h 2007-07-31 07:38:23 UTC (rev
2581)
@@ -41,8 +41,11 @@
};
/* we can't take any _single_ response bigger than this: */
-#define LLPARSE_BUF_SIZE 256
+#define LLPARSE_BUF_SIZE 1024
+/* we can't pare a mutiline response biger than this: */
+#define MLPARSE_BUF_SIZE 65535
+
struct llparser {
enum llparse_state state;
unsigned int len;
Modified: trunk/src/target/gsm/src/gsmd/atcmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/atcmd.c 2007-07-31 07:29:00 UTC (rev
2580)
+++ trunk/src/target/gsm/src/gsmd/atcmd.c 2007-07-31 07:38:23 UTC (rev
2581)
@@ -175,7 +175,9 @@
{
struct gsmd *g = ctx;
struct gsmd_atcmd *cmd = NULL;
+ static char mlbuf[MLPARSE_BUF_SIZE];
int rc = 0, final = 0;
+ int mlbuf_len;
DEBUGP("buf=`%s'(%d)\n", buf, len);
@@ -268,12 +270,22 @@
/* if we survive till here, it's a valid extd response
* to an extended command and thus Case 'A' */
-
- /* FIXME: solve multi-line responses ! */
- if (cmd->buflen < len)
- len = cmd->buflen;
- memcpy(cmd->buf, buf, len);
+ /* it might be a multiline response, so if there's a
previous
+ response, send out mlbuf and start afresh with an
empty buffer */
+ if (mlbuf[0] != 0) {
+ if (!cmd->cb) {
+ gsmd_log(GSMD_NOTICE, "command without
cb!!!\n");
+ } else {
+ DEBUGP("Calling cmd->cb()\n");
+ cmd->resp = mlbuf;
+ rc = cmd->cb(cmd, cmd->ctx, cmd->resp);
+ DEBUGP("Clearing mlbuf\n");
+ mlbuf[0] = 0;
+ }
+ }
+
+ /* the current buf will be appended to mlbuf below */
}
} else {
if (!strcmp(buf, "RING") ||
@@ -322,8 +334,25 @@
/* we reach here, if we are at an information response that needs to be
* passed on */
+ if (mlbuf[0] == 0) {
+ DEBUGP("Filling mlbuf\n");
+ strncat(mlbuf, buf, sizeof(mlbuf)-1);
+ } else {
+ DEBUGP("Appending buf to mlbuf\n");
+ mlbuf_len = strlen(mlbuf);
+ if (mlbuf_len+1 < sizeof(mlbuf)) {
+ mlbuf[mlbuf_len] = '\n';
+ mlbuf[mlbuf_len+1] = '\0';
+ strncat(mlbuf, buf, sizeof(mlbuf)-mlbuf_len-2);
+ } else {
+ DEBUGP("response too big for mlbuf!!!\n");
+ return -EFBIG;
+ }
+ }
+ return 0;
+
final_cb:
- /* if we reach here, the final result code of a command has been
reached */
+ /* if reach here, the final result code of a command has been reached */
if (!cmd)
return rc;
@@ -334,24 +363,25 @@
if (!cmd->cb) {
gsmd_log(GSMD_NOTICE, "command without cb!!!\n");
} else {
- if (!final || !cmd->resp) {
- /* if we reach here, we didn't send any information
responses yet */
- DEBUGP("Calling cmd->cb()\n");
+ DEBUGP("Calling final cmd->cb()\n");
+ /* send final result code if there is no information response
in mlbuf */
+ if (mlbuf[0] == 0)
cmd->resp = buf;
- rc = cmd->cb(cmd, cmd->ctx, buf);
- }
+ else
+ cmd->resp = mlbuf;
+ rc = cmd->cb(cmd, cmd->ctx, cmd->resp);
+ DEBUGP("Clearing mlbuf\n");
+ mlbuf[0] = 0;
}
- if (final) {
- /* remove from list of currently executing cmds */
- llist_del(&cmd->list);
- talloc_free(cmd);
+ /* remove from list of currently executing cmds */
+ llist_del(&cmd->list);
+ talloc_free(cmd);
- /* if we're finished with current commands, but still have
pending
- * commands: we want to WRITE again */
- if (llist_empty(&g->busy_atcmds) &&
!llist_empty(&g->pending_atcmds))
- g->gfd_uart.when |= GSMD_FD_WRITE;
- }
+ /* if we're finished with current commands, but still have pending
+ * commands: we want to WRITE again */
+ if (llist_empty(&g->busy_atcmds) && !llist_empty(&g->pending_atcmds))
+ g->gfd_uart.when |= GSMD_FD_WRITE;
return rc;
}
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog