From: Philippe Nunes <philippe.nunes@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 6/7] cdma-netreg: Make use of the new driver entry point serving_system
Date: Thu, 24 Nov 2011 18:46:23 +0100 [thread overview]
Message-ID: <1322156784-10402-7-git-send-email-philippe.nunes@linux.intel.com> (raw)
In-Reply-To: <1322156784-10402-1-git-send-email-philippe.nunes@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]
---
src/cdma-netreg.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/cdma-netreg.c b/src/cdma-netreg.c
index 739d1ef..222c3b7 100644
--- a/src/cdma-netreg.c
+++ b/src/cdma-netreg.c
@@ -104,6 +104,24 @@ static GDBusSignalTable cdma_netreg_manager_signals[] = {
{ }
};
+static void serving_system_callback(const struct ofono_error *error,
+ const char *sid, void *data)
+{
+ struct ofono_cdma_netreg *cdma_netreg = data;
+
+ if (cdma_netreg->status != CDMA_NETWORK_REGISTRATION_STATUS_REGISTERED
+ && cdma_netreg->status !=
+ CDMA_NETWORK_REGISTRATION_STATUS_ROAMING)
+ return;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ DBG("Error during serving system query");
+ return;
+ }
+
+ DBG("Serving system Identifier: %s", sid);
+}
+
static void set_registration_status(struct ofono_cdma_netreg *cdma_netreg,
enum cdma_netreg_status status)
{
@@ -117,6 +135,13 @@ static void set_registration_status(struct ofono_cdma_netreg *cdma_netreg,
OFONO_CDMA_NETWORK_REGISTRATION_INTERFACE,
"Status", DBUS_TYPE_STRING,
&str_status);
+
+ if (cdma_netreg->status == CDMA_NETWORK_REGISTRATION_STATUS_REGISTERED
+ || cdma_netreg->status ==
+ CDMA_NETWORK_REGISTRATION_STATUS_ROAMING)
+ if (cdma_netreg->driver->serving_system != NULL)
+ cdma_netreg->driver->serving_system(cdma_netreg,
+ serving_system_callback, cdma_netreg);
}
void ofono_cdma_netreg_status_notify(struct ofono_cdma_netreg *cdma_netreg,
--
1.7.1
next prev parent reply other threads:[~2011-11-24 17:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 17:46 [PATCH 0/7] Get SID and provider name Philippe Nunes
2011-11-24 17:46 ` [PATCH 1/7] Huaweicdmamodem: remove this specific driver Philippe Nunes
2011-11-24 17:46 ` [PATCH 2/7] huaweicdmamodem: Merge this driver with cdmamodem driver Philippe Nunes
2011-11-24 17:46 ` [PATCH 3/7] cdmamodem: Add CDMA network-registration support Philippe Nunes
2011-11-24 17:46 ` [PATCH 4/7] cdma-netreg: Add 'serving_system' entry point to cdma-netreg to get SID Philippe Nunes
2011-11-24 23:42 ` Denis Kenzior
2011-11-24 17:46 ` [PATCH 5/7] cdmamodem: Add serving system identifier support Philippe Nunes
2011-11-24 17:46 ` Philippe Nunes [this message]
2011-11-24 23:51 ` [PATCH 6/7] cdma-netreg: Make use of the new driver entry point serving_system Denis Kenzior
2011-11-24 17:46 ` [PATCH 7/7] cdma-netreg: Add provider name support Philippe Nunes
2011-11-24 23:55 ` Denis Kenzior
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=1322156784-10402-7-git-send-email-philippe.nunes@linux.intel.com \
--to=philippe.nunes@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