Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 3/5] emulator: Add set/get data APIs
Date: Tue, 05 Feb 2013 17:26:58 +0100	[thread overview]
Message-ID: <1360081620-19458-3-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1360081620-19458-1-git-send-email-frederic.danis@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

---
 src/emulator.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/emulator.c b/src/emulator.c
index c3165eb..14a39f3 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -52,6 +52,8 @@ struct ofono_emulator {
 	gboolean clip;
 	gboolean ccwa;
 	int pns_id;
+	void *data;
+	ofono_destroy_func destroy;
 };
 
 struct indicator {
@@ -951,6 +953,9 @@ static void emulator_remove(struct ofono_atom *atom)
 
 	DBG("atom: %p", atom);
 
+	if (em->destroy)
+		em->destroy(em->data);
+
 	g_free(em);
 }
 
@@ -994,6 +999,18 @@ void ofono_emulator_remove(struct ofono_emulator *em)
 	__ofono_atom_free(em->atom);
 }
 
+void ofono_emulator_set_data(struct ofono_emulator *em, void *data,
+						ofono_destroy_func destroy)
+{
+	em->data = data;
+	em->destroy = destroy;
+}
+
+void *ofono_emulator_get_data(struct ofono_emulator *em)
+{
+	return em->data;
+}
+
 void ofono_emulator_send_final(struct ofono_emulator *em,
 				const struct ofono_error *final)
 {
-- 
1.7.9.5


  parent reply	other threads:[~2013-02-05 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05 16:26 [PATCH 1/5] bluez5: Add SCO server register/unregister =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2013-02-05 16:26 ` [PATCH 2/5] include: Add set/get data APIs to emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2013-02-05 16:26 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
2013-02-05 16:26 ` [PATCH 4/5] hfp_ag_bluez5: Add list of HFP AG emulators =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2013-02-05 16:27 ` [PATCH 5/5] hfp_ag_bluez5: Add SCO listen socket =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360081620-19458-3-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox