diff options
author | erin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2008-03-06 09:35:12 +0000 |
---|---|---|
committer | erin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2008-03-06 09:35:12 +0000 |
commit | 636e8ecfdf47c6441975e41ed3f39dace55485c6 (patch) | |
tree | af38a8465ff88f7ffef39727b40935d1cc5d704f /src/gsmd | |
parent | dc73a4a864610c3f9d5a175d30f9a168e3dc88fd (diff) |
gsmd: Query Antenna Status (Erin Yueh)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@4174 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/gsmd')
-rw-r--r-- | src/gsmd/usock.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c index c7f8827..aa2c7b5 100644 --- a/src/gsmd/usock.c +++ b/src/gsmd/usock.c @@ -613,6 +613,15 @@ static int phone_powerdown_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) cmd->id, sizeof(ret), &ret); } +static int phone_power_status_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) +{ + DEBUGP("resp: %s\n", resp); + if (!strncmp(resp, "+CFUN: ", 7)) + resp += 7; + return gsmd_ucmd_submit(ctx, GSMD_MSG_PHONE, GSMD_PHONE_POWER_STATUS, + cmd->id, strlen(resp) + 1, resp); +} + static int phone_get_manuf_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) { struct gsmd_user *gu = ctx; @@ -721,6 +730,11 @@ static int usock_rcv_phone(struct gsmd_user *gu, struct gsmd_msg_hdr *gph, &phone_powerdown_cb, gu, 0, NULL); gu->gsmd->dev_state.on = 0; break; + case GSMD_PHONE_POWER_STATUS: + cmd = atcmd_fill("AT+CFUN?", 8+1, + &phone_power_status_cb, gu, 0, NULL); + break; + case GSMD_PHONE_GET_IMSI: return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_IMSI, 0, strlen(gu->gsmd->imsi) + 1, gu->gsmd->imsi); |