diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-07-27 18:02:04 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-07-27 18:02:32 +0200 |
commit | 77ab26c61ccb908670407a158f61a20cb22393da (patch) | |
tree | dd1dd1eca02bb322d01627eb483df53daf89d6cc /plugins/zte.c | |
parent | 0b71a711582566520ab68746f40ec96d6e5726f5 (diff) | |
download | ofono-77ab26c61ccb908670407a158f61a20cb22393da.tar.bz2 |
zte: Delay sending of AT&C0 to disable data carrier detect
The &C0 can not be send as part of the initial modem init string
since then it return with an error. Also sending it right after seems
to end up in a race condition with the modem init.
So send AT&C0 on both channel after AT+CFUN completed.
Diffstat (limited to 'plugins/zte.c')
-rw-r--r-- | plugins/zte.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/zte.c b/plugins/zte.c index 4426b4c6..4ed41917 100644 --- a/plugins/zte.c +++ b/plugins/zte.c @@ -133,9 +133,16 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data) g_at_chat_unref(data->aux); data->aux = NULL; + + ofono_modem_set_powered(modem, FALSE); + return; } - ofono_modem_set_powered(modem, ok); + /* AT&C0 needs to be send separate and on both channel */ + g_at_chat_send(data->modem, "AT&C0", NULL, NULL, NULL, NULL); + g_at_chat_send(data->aux, "AT&C0", NULL, NULL, NULL, NULL); + + ofono_modem_set_powered(modem, TRUE); } static int zte_enable(struct ofono_modem *modem) @@ -155,8 +162,8 @@ static int zte_enable(struct ofono_modem *modem) return -EIO; } - g_at_chat_send(data->modem, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL); - g_at_chat_send(data->aux, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL); + g_at_chat_send(data->modem, "ATE0 +CMEE=1", NULL, NULL, NULL, NULL); + g_at_chat_send(data->aux, "ATE0 +CMEE=1", NULL, NULL, NULL, NULL); /* Direct transition 0 -> 4 leaves SIM hosed */ g_at_chat_send(data->aux, "AT+CFUN=1;+CFUN=4", NULL, |