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. r2734 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
2. r2735 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
3. r2736 - in trunk/src/target/gsm: include/gsmd src/gsmd
([EMAIL PROTECTED])
4. r2737 - trunk/src/target/gsm/include/libgsmd
([EMAIL PROTECTED])
5. r2738 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
--- Begin Message ---
Author: laforge
Date: 2007-08-17 12:01:25 +0200 (Fri, 17 Aug 2007)
New Revision: 2734
Added:
trunk/src/target/gsm/src/gsmd/vendor_bcm.c
Modified:
trunk/src/target/gsm/src/gsmd/Makefile.am
trunk/src/target/gsm/src/gsmd/machine.c
Log:
Add Broadcom BCM2132 vendor plugin (Alex Osborne)
Modified: trunk/src/target/gsm/src/gsmd/Makefile.am
===================================================================
--- trunk/src/target/gsm/src/gsmd/Makefile.am 2007-08-17 08:36:48 UTC (rev
2733)
+++ trunk/src/target/gsm/src/gsmd/Makefile.am 2007-08-17 10:01:25 UTC (rev
2734)
@@ -21,7 +21,8 @@
libgsmd-machine_tihtc.la \
libgsmd-vendor_ti.la \
libgsmd-vendor_tihtc.la \
- libgsmd-vendor_qc.la
+ libgsmd-vendor_qc.la \
+ libgsmd-vendor_bcm.la
libgsmd_machine_generic_la_SOURCES = machine_generic.c
libgsmd_machine_generic_la_LDFLAGS = -module
@@ -34,5 +35,8 @@
libgsmd_vendor_tihtc_la_LDFLAGS = -module
libgsmd_vendor_qc_la_SOURCES = vendor_qc.c
libgsmd_vendor_qc_la_LDFLAGS = -module
+libgsmd_vendor_bcm_la_SOURCES = vendor_bcm.c
+libgsmd_vendor_bcm_la_LDFLAGS = -module
+
noinst_HEADERS = gsmd.h
Modified: trunk/src/target/gsm/src/gsmd/machine.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/machine.c 2007-08-17 08:36:48 UTC (rev
2733)
+++ trunk/src/target/gsm/src/gsmd/machine.c 2007-08-17 10:01:25 UTC (rev
2734)
@@ -100,6 +100,7 @@
{ "HTC Himalaya", "tihtc", "tihtc" },
{ "HTC Magician", "tihtc", "tihtc" },
{ "HTC Universal", "generic", "qc" },
+ { "Palm Treo 650", "generic", "bcm" },
{ NULL, NULL, NULL },
};
@@ -157,6 +158,7 @@
gsmd_vendor_plugin_load("ti");
gsmd_vendor_plugin_load("tihtc");
gsmd_vendor_plugin_load("qc");
+ gsmd_vendor_plugin_load("bcm");
}
return rc;
Added: trunk/src/target/gsm/src/gsmd/vendor_bcm.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_bcm.c 2007-08-17 08:36:48 UTC (rev
2733)
+++ trunk/src/target/gsm/src/gsmd/vendor_bcm.c 2007-08-17 10:01:25 UTC (rev
2734)
@@ -0,0 +1,112 @@
+/* Broadcom [BCM2132] gsmd plugin
+ *
+ * Written by Alex Osborne <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include "gsmd.h"
+
+#include <gsmd/gsmd.h>
+#include <gsmd/usock.h>
+#include <gsmd/event.h>
+#include <gsmd/talloc.h>
+#include <gsmd/extrsp.h>
+#include <gsmd/atcmd.h>
+#include <gsmd/vendorplugin.h>
+#include <gsmd/unsolicited.h>
+
+static int mrdy_parse(char *buf, int len, const char *param,
+ struct gsmd *g)
+{
+ int status = atoi(param);
+ DEBUGP("entering mrdy_parse param=`%s'\n", param);
+
+ switch (status) {
+ case 1:
+ DEBUGP("Module is ready.\n");
+ break;
+ case 2:
+ DEBUGP("Emergency call is ready.\n");
+ break;
+ case 3:
+ DEBUGP("All AT commands are ready.\n");
+ break;
+ case 4:
+ DEBUGP("SIM card inserted.\n");
+ break;
+ case 5:
+ DEBUGP("SIM card removed.\n");
+ break;
+ case 6:
+ DEBUGP("No access - limited service.\n");
+ break;
+ case 7:
+ DEBUGP("SOS - limited service.\n");
+ break;
+ default:
+ DEBUGP("Unknown module ready status %d\n", status);
+ }
+
+ return 0;
+}
+
+static int mtsmenu_parse(char *buf, int len, const char *param,
+ struct gsmd *g)
+{
+ char *tok, *param_tmp;
+ struct mtsmenu *mtsmenu;
+
+ DEBUGP("mtsmenu_parse param=`%s'\n", param);
+ return 0;
+}
+
+static const struct gsmd_unsolicit bcm_unsolicit[] = {
+ { "*MRDY", &mrdy_parse }, /* Module Ready Status */
+ { "*MTSMENU", &mtsmenu_parse }, /* Set Up Menu (SAT) */
+
+ /* FIXME: determine other unsolicited responses */
+};
+
+static int bcm_detect(struct gsmd *g)
+{
+ /* FIXME: do actual detection of vendor if we have multiple vendors */
+ return 1;
+}
+
+static int bcm_initsettings(struct gsmd *g)
+{
+ int rc;
+ struct gsmd_atcmd *cmd;
+
+ /* TODO */
+ return rc;
+}
+
+struct gsmd_vendor_plugin gsmd_vendor_plugin = {
+ .name = "Broadcom BCM2132",
+ .ext_chars = "*",
+ .num_unsolicit = ARRAY_SIZE(bcm_unsolicit),
+ .unsolicit = bcm_unsolicit,
+ .detect = &bcm_detect,
+ .initsettings = &bcm_initsettings,
+};
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-08-17 12:02:02 +0200 (Fri, 17 Aug 2007)
New Revision: 2735
Modified:
trunk/src/target/gsm/src/gsmd/gsmd.c
Log:
Change alive check and first commands to bare "AT"
The BCM2132 responds ERROR to ATV and ATE when it is in the radio off
mode (AT+CFUN=0). This causes the alive check and first command to both
fail so this changes them both to just bare AT. (Alex Osborne)
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2007-08-17 10:01:25 UTC (rev
2734)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2007-08-17 10:02:02 UTC (rev
2735)
@@ -45,7 +45,7 @@
#include <gsmd/vendorplugin.h>
#include <gsmd/talloc.h>
-#define GSMD_ALIVECMD "ATE0"
+#define GSMD_ALIVECMD "AT"
#define GSMD_ALIVE_INTERVAL 5*60
#define GSMD_ALIVE_TIMEOUT 30
@@ -238,7 +238,7 @@
struct gsmd_atcmd *cmd;
struct timeval tv;
- cmd = atcmd_fill("ATE0V1", strlen("ATE0V1")+1, &firstcmd_atcb, gsmd, 0);
+ cmd = atcmd_fill("AT", strlen("AT")+1, &firstcmd_atcb, gsmd, 0);
if (!cmd)
return -ENOMEM;
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-08-17 12:02:26 +0200 (Fri, 17 Aug 2007)
New Revision: 2736
Modified:
trunk/src/target/gsm/include/gsmd/gsmd.h
trunk/src/target/gsm/src/gsmd/atcmd.c
trunk/src/target/gsm/src/gsmd/vendor_bcm.c
Log:
Add a flag to allow LFCR as a valid linebreak. (Alex Osborne)
Modified: trunk/src/target/gsm/include/gsmd/gsmd.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/gsmd.h 2007-08-17 10:02:02 UTC (rev
2735)
+++ trunk/src/target/gsm/include/gsmd/gsmd.h 2007-08-17 10:02:26 UTC (rev
2736)
@@ -17,6 +17,7 @@
/* Refer to 3GPP TS 07.07 v 7.8.0, Chapter 4.1 */
#define LGSM_ATCMD_F_EXTENDED 0x01 /* as opposed to basic */
#define LGSM_ATCMD_F_PARAM 0x02 /* as opposed to action */
+#define LGSM_ATCMD_F_LFCR 0x04 /* accept LFCR as a line terminator */
struct gsmd_atcmd {
struct llist_head list;
@@ -37,6 +38,7 @@
LLPARSE_STATE_IDLE_LF, /* LF before response (V1) */
LLPARSE_STATE_RESULT, /* within result payload */
LLPARSE_STATE_RESULT_CR, /* CR after result */
+ LLPARSE_STATE_RESULT_LF, /* LF after result */
LLPARSE_STATE_PROMPT, /* within a "> " prompt */
LLPARSE_STATE_PROMPT_SPC, /* a complete "> " prompt */
LLPARSE_STATE_ERROR, /* something went wrong */
Modified: trunk/src/target/gsm/src/gsmd/atcmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/atcmd.c 2007-08-17 10:02:02 UTC (rev
2735)
+++ trunk/src/target/gsm/src/gsmd/atcmd.c 2007-08-17 10:02:26 UTC (rev
2736)
@@ -76,6 +76,14 @@
}
}
+static inline void llparse_endline(struct llparser *llp)
+{
+ /* re-set cursor to start of buffer */
+ llp->cur = llp->buf;
+ llp->state = LLPARSE_STATE_IDLE;
+ memset(llp->buf, 0, LLPARSE_BUF_SIZE);
+}
+
static int llparse_byte(struct llparser *llp, char byte)
{
int ret = 0;
@@ -121,17 +129,19 @@
case LLPARSE_STATE_RESULT:
if (byte == '\r')
llp->state = LLPARSE_STATE_RESULT_CR;
+ else if ((llp->flags & LGSM_ATCMD_F_LFCR) && byte == '\n')
+ llp->state = LLPARSE_STATE_RESULT_LF;
else
ret = llparse_append(llp, byte);
break;
case LLPARSE_STATE_RESULT_CR:
- if (byte == '\n') {
- /* re-set cursor to start of buffer */
- llp->cur = llp->buf;
- llp->state = LLPARSE_STATE_IDLE;
- memset(llp->buf, 0, LLPARSE_BUF_SIZE);
- }
+ if (byte == '\n')
+ llparse_endline(llp);
break;
+ case LLPARSE_STATE_RESULT_LF:
+ if (byte == '\r')
+ llparse_endline(llp);
+ break;
case LLPARSE_STATE_PROMPT:
if (byte == ' ')
llp->state = LLPARSE_STATE_PROMPT_SPC;
Modified: trunk/src/target/gsm/src/gsmd/vendor_bcm.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_bcm.c 2007-08-17 10:02:02 UTC (rev
2735)
+++ trunk/src/target/gsm/src/gsmd/vendor_bcm.c 2007-08-17 10:02:26 UTC (rev
2736)
@@ -98,6 +98,9 @@
int rc;
struct gsmd_atcmd *cmd;
+ /* bcm sometimes sends LFCR instead of CRLF (eg *MTSMENU message) */
+ g->llp.flags |= LGSM_ATCMD_F_LFCR;
+
/* TODO */
return rc;
}
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-08-17 12:03:06 +0200 (Fri, 17 Aug 2007)
New Revision: 2737
Modified:
trunk/src/target/gsm/include/libgsmd/Makefile.am
Log:
Add Headers to pkginclude (Philipp Zabel <[EMAIL PROTECTED]>)
src/util/pin.h is a local header to libgsmd-tool. The pin.h
header of libgsmd is in include/libgsmd.
The attached patch adds libgsmd/sms.h and pin.h to the list of
installed headers.
Modified: trunk/src/target/gsm/include/libgsmd/Makefile.am
===================================================================
--- trunk/src/target/gsm/include/libgsmd/Makefile.am 2007-08-17 10:02:26 UTC
(rev 2736)
+++ trunk/src/target/gsm/include/libgsmd/Makefile.am 2007-08-17 10:03:06 UTC
(rev 2737)
@@ -1,2 +1,3 @@
pkgincludedir = $(includedir)/libgsmd
-pkginclude_HEADERS = event.h handset.h libgsmd.h misc.h phonebook.h voicecall.h
+pkginclude_HEADERS = event.h handset.h libgsmd.h misc.h \
+ phonebook.h pin.h sms.h voicecall.h
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-08-17 12:03:26 +0200 (Fri, 17 Aug 2007)
New Revision: 2738
Modified:
trunk/src/target/gsm/src/gsmd/gsmd.c
Log:
Change copyrigt to OpenMoko and contributors
Modified: trunk/src/target/gsm/src/gsmd/gsmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/gsmd.c 2007-08-17 10:03:06 UTC (rev
2737)
+++ trunk/src/target/gsm/src/gsmd/gsmd.c 2007-08-17 10:03:26 UTC (rev
2738)
@@ -323,7 +323,7 @@
static void print_header(void)
{
- printf("gsmd - (C) 2006-2007 by Harald Welte <[EMAIL PROTECTED]>\n"
+ printf("gsmd - (C) 2006-2007 by OpenMoko, Inc. and contributors\n"
"This program is FREE SOFTWARE under the terms of GNU GPL\n\n");
}
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog