From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3733386178275645325==" MIME-Version: 1.0 From: Philippe Nunes Subject: [PATCH v4 1/6] gatchat: Add g_at_chat_set_slave_qcdm / g_at_chat_get_slave_qcdm Date: Wed, 18 Jan 2012 18:05:12 +0100 Message-ID: <1326906317-11601-2-git-send-email-philippe.nunes@linux.intel.com> In-Reply-To: <1326906317-11601-1-git-send-email-philippe.nunes@linux.intel.com> List-Id: To: ofono@ofono.org --===============3733386178275645325== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --- gatchat/gatchat.c | 26 ++++++++++++++++++++++++++ gatchat/gatchat.h | 4 ++++ 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 7a0ef35..2fde572 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -35,6 +35,7 @@ #include "ringbuffer.h" #include "gatchat.h" #include "gatio.h" +#include "gathdlc.h" = /* #define WRITE_SCHEDULER_DEBUG 1 */ = @@ -110,6 +111,7 @@ struct _GAtChat { struct at_chat *parent; guint group; GAtChat *slave; + GAtHDLC *qcdm; }; = struct terminator_info { @@ -1354,6 +1356,30 @@ GAtChat *g_at_chat_get_slave(GAtChat *chat) return chat->slave; } = +GAtHDLC *g_at_chat_set_slave_qcdm(GAtChat *chat, GAtHDLC *diag) +{ + if (chat =3D=3D NULL) + return NULL; + + if (chat->qcdm !=3D NULL) + g_at_hdlc_unref(chat->qcdm); + + if (diag !=3D NULL) + chat->qcdm =3D g_at_hdlc_ref(diag); + else + chat->qcdm =3D NULL; + + return chat->qcdm; +} + +GAtHDLC *g_at_chat_get_slave_qcdm(GAtChat *chat) +{ + if (chat =3D=3D NULL) + return NULL; + + return chat->qcdm; +} + GIOChannel *g_at_chat_get_channel(GAtChat *chat) { if (chat =3D=3D NULL || chat->parent->io =3D=3D NULL) diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h index 367581e..496b3dc 100644 --- a/gatchat/gatchat.h +++ b/gatchat/gatchat.h @@ -30,6 +30,7 @@ extern "C" { #include "gatsyntax.h" #include "gatutil.h" #include "gatio.h" +#include "gathdlc.h" = struct _GAtChat; = @@ -68,6 +69,9 @@ GAtChat *g_at_chat_clone(GAtChat *chat); GAtChat *g_at_chat_set_slave(GAtChat *chat, GAtChat *slave); GAtChat *g_at_chat_get_slave(GAtChat *chat); = +GAtHDLC *g_at_chat_set_slave_qcdm(GAtChat *chat, GAtHDLC *diag); +GAtHDLC *g_at_chat_get_slave_qcdm(GAtChat *chat); + void g_at_chat_suspend(GAtChat *chat); void g_at_chat_resume(GAtChat *chat); = -- = 1.7.1 --===============3733386178275645325==--