diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-16 04:16:26 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-16 04:16:26 +0000 |
commit | 00361c2946aef3975e302d5a5957ae239da21de8 (patch) | |
tree | cb7a44ee1f43ff01675f7683967bdfb4b147a686 /src/gsmd/usock.c | |
parent | a07e020b6d485037ae592ab7e1bd564bb8a597d4 (diff) |
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Wed, 11 Jul 2007 16:03:16 +0200
Subject: [PATCH] Multiline commands support. Miscellaneous bugs.
This adds support for commands like +CMGS and +CMGW that span mroe than one
line and the lines can't be sent to modem as separate commands because every
next line has to wait for a "> " prompt from modem before writing (otherwise
beginnings of the lines get eaten).
This patch also corrects a number of miscellaneous glitches that I have hit. I
can split them each out if needed, but they are all quite obvious. The
cms_error variable is introduced because there are CME and possibly other
errors with the same codes, which resulted in that when I was sending a message
and got error 42 ("congestion") on sending, openmoko-dialer asked for PIN
because CMS event 42 happens to be PIN inquiry. The change in libgsmd-tool
fixes the issue described by Philipp Zabel on the list, with usock locking up.
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2709 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/gsmd/usock.c')
-rw-r--r-- | src/gsmd/usock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c index 617c9f2..db073a4 100644 --- a/src/gsmd/usock.c +++ b/src/gsmd/usock.c @@ -75,7 +75,7 @@ static int usock_cmd_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) ucmd->hdr.version = GSMD_PROTO_VERSION; ucmd->hdr.msg_type = GSMD_MSG_PASSTHROUGH; ucmd->hdr.msg_subtype = GSMD_PASSTHROUGH_RESP; - ucmd->hdr.len = strlen(resp)+1; + ucmd->hdr.len = rlen; ucmd->hdr.id = cmd->id; memcpy(ucmd->buf, resp, ucmd->hdr.len); @@ -100,7 +100,7 @@ static int usock_rcv_passthrough(struct gsmd_user *gu, struct gsmd_msg_hdr *gph, static int usock_rcv_event(struct gsmd_user *gu, struct gsmd_msg_hdr *gph, int len) { - u_int32_t *evtmask = (u_int32_t *) ((char *)gph + sizeof(*gph), gph->id); + u_int32_t *evtmask = (u_int32_t *) ((char *)gph + sizeof(*gph)); if (len < sizeof(*gph) + sizeof(u_int32_t)) return -EINVAL; |