diff options
author | Guillaume Zajac <guillaume.zajac@linux.intel.com> | 2011-05-20 11:38:12 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-05-24 12:25:07 -0500 |
commit | ce71d75675120ae06d6ea8d8dee341c578a7353b (patch) | |
tree | 72f7a24790cd17a032f6f3e55f5a8acc71825ff8 /gatchat/gathdlc.c | |
parent | a8e58a5f394d39ab99ed6d173c31dd0d1ab2986d (diff) | |
download | ofono-ce71d75675120ae06d6ea8d8dee341c578a7353b.tar.bz2 |
gathdlc: add g_at_hdlc_resume() API
Diffstat (limited to 'gatchat/gathdlc.c')
-rw-r--r-- | gatchat/gathdlc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c index 7989bd7c..d04ba384 100644 --- a/gatchat/gathdlc.c +++ b/gatchat/gathdlc.c @@ -622,3 +622,19 @@ void g_at_hdlc_suspend(GAtHDLC *hdlc) g_at_io_set_write_handler(hdlc->io, NULL, NULL); g_at_io_set_read_handler(hdlc->io, NULL, NULL); } + +static void hdlc_wakeup_writer(GAtHDLC *hdlc) +{ + g_at_io_set_write_handler(hdlc->io, can_write_data, hdlc); +} + +void g_at_hdlc_resume(GAtHDLC *hdlc) +{ + if (hdlc == NULL) + return; + + g_at_io_set_read_handler(hdlc->io, new_bytes, hdlc); + + if (g_queue_get_length(hdlc->write_queue) > 0) + hdlc_wakeup_writer(hdlc); +} |