diff options
author | Martin Hundebøll <martin@geanix.com> | 2019-08-12 22:38:31 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-08-13 02:09:09 -0500 |
commit | e69a30f1df057407987931fc4f84c0f8e4687bd1 (patch) | |
tree | 7338466323f976048d8d089a1fe6a6356bf88558 /gatchat/gatchat.h | |
parent | e3d5ac1f166668e111d80f8a7fa0211978b5ad7d (diff) | |
download | ofono-e69a30f1df057407987931fc4f84c0f8e4687bd1.tar.gz |
gatchat: add g_at_chat_retry()
The current API doesn't support canceling an in-progress command;
instead g_at_chat_cancel() simply removes the callback.
In cases where the modem doesn't respond at all to a command, a chat is
simply stalled without any way to write new commands to the modem.
Support that case by adding a g_at_chat_retry() function to the API. The
function does nothing if the command is not yet in-progress, or if the
command is finished. Otherwise, it resets the bytes-written counter to
re-write the command string.
Diffstat (limited to 'gatchat/gatchat.h')
-rw-r--r-- | gatchat/gatchat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h index 7290b34f..32870318 100644 --- a/gatchat/gatchat.h +++ b/gatchat/gatchat.h @@ -147,6 +147,13 @@ guint g_at_chat_send_and_expect_short_prompt(GAtChat *chat, const char *cmd, const char **valid_resp, GAtResultFunc func, gpointer user_data, GDestroyNotify notify); +/*! + * Retry an already created command. This does nothing if the command is + * still waiting in the queue. If the command has been written to the channel, + * but no response is received yet, the retry writes the command again. + */ +gboolean g_at_chat_retry(GAtChat *chat, guint id); + gboolean g_at_chat_cancel(GAtChat *chat, guint id); gboolean g_at_chat_cancel_all(GAtChat *chat); |