diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-07-15 11:45:17 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-07-15 11:50:04 -0500 |
commit | 3dcf25807a0cf7f8429cc6f35e009bb15500ab19 (patch) | |
tree | a605d3425f21addccf358e2a0135044fbd74c39a | |
parent | 2effe636670efbcb443c88254c6a3e29c43d315a (diff) | |
download | ofono-3dcf25807a0cf7f8429cc6f35e009bb15500ab19.tar.bz2 |
Fix modem wakeup handling
-rw-r--r-- | gatchat/gatchat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 32f0b592..dfd60d5f 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -765,6 +765,14 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond, static gboolean wakeup_no_response(gpointer user) { GAtChat *chat = user; + struct at_command *cmd = g_queue_peek_head(chat->command_queue); + + /* Sometimes during startup the modem is still in the ready state + * and might acknowledge our 'wakeup' command. In that case don't + * timeout the wrong command + */ + if (cmd == NULL || cmd->id != 0) + return FALSE; g_at_chat_finish_command(chat, FALSE, NULL); |