summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-07-27 16:52:16 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-07-27 16:52:16 -0500
commitcf86deeb828f83d094d10e2dc83b5a66be6d2462 (patch)
tree6a2acd16e144928c05b96386e776692b81cd6b81 /src
parent6f1ab8b6794333673fefc3d52f9b0388526a56cd (diff)
downloadofono-cf86deeb828f83d094d10e2dc83b5a66be6d2462.tar.bz2
netreg: Add MCC/MNC to NetworkRegistration
These are the same values as on the NetworkOperator interface for the current operator. Just added for convenience.
Diffstat (limited to 'src')
-rw-r--r--src/network.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index c6410a8a..9fa9d032 100644
--- a/src/network.c
+++ b/src/network.c
@@ -776,6 +776,20 @@ static DBusMessage *network_get_properties(DBusConnection *conn,
&technology);
}
+ if (netreg->current_operator) {
+ if (netreg->current_operator->mcc[0] != '\0') {
+ const char *mcc = netreg->current_operator->mcc;
+ ofono_dbus_dict_append(&dict, "MobileCountryCode",
+ DBUS_TYPE_STRING, &mcc);
+ }
+
+ if (netreg->current_operator->mnc[0] != '\0') {
+ const char *mnc = netreg->current_operator->mnc;
+ ofono_dbus_dict_append(&dict, "MobileNetworkCode",
+ DBUS_TYPE_STRING, &mnc);
+ }
+ }
+
operator = get_operator_display_name(netreg);
ofono_dbus_dict_append(&dict, "Name", DBUS_TYPE_STRING, &operator);
@@ -1299,6 +1313,24 @@ emit:
"Name", DBUS_TYPE_STRING,
&operator);
+ if (netreg->current_operator) {
+ if (netreg->current_operator->mcc[0] != '\0') {
+ const char *mcc = netreg->current_operator->mcc;
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_NETWORK_REGISTRATION_INTERFACE,
+ "MobileCountryCode",
+ DBUS_TYPE_STRING, &mcc);
+ }
+
+ if (netreg->current_operator->mnc[0] != '\0') {
+ const char *mnc = netreg->current_operator->mnc;
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_NETWORK_REGISTRATION_INTERFACE,
+ "MobileNetworkCode",
+ DBUS_TYPE_STRING, &mnc);
+ }
+ }
+
notify_status_watches(netreg);
}