mirror of git://git.sysmocom.de/ofono
Move netreg interface definitions to dbus.h
This commit is contained in:
parent
5609034d97
commit
01a4a93bee
|
@ -39,6 +39,8 @@ extern "C" {
|
|||
#define OFONO_CALL_VOLUME_INTERFACE OFONO_SERVICE ".CallVolume"
|
||||
#define OFONO_CBS_MANAGER_INTERFACE "org.ofono.CbsManager"
|
||||
#define OFONO_MESSAGE_WAITING_INTERFACE "org.ofono.MessageWaiting"
|
||||
#define OFONO_NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration"
|
||||
#define OFONO_NETWORK_OPERATOR_INTERFACE "org.ofono.NetworkOperator"
|
||||
#define OFONO_PHONEBOOK_INTERFACE "org.ofono.Phonebook"
|
||||
#define OFONO_RADIO_SETTINGS_INTERFACE "org.ofono.RadioSettings"
|
||||
#define OFONO_SIM_MANAGER_INTERFACE "org.ofono.SimManager"
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
#include "util.h"
|
||||
#include "storage.h"
|
||||
|
||||
#define NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration"
|
||||
#define NETWORK_OPERATOR_INTERFACE "org.ofono.NetworkOperator"
|
||||
|
||||
#define NETWORK_REGISTRATION_FLAG_HOME_SHOW_PLMN 0x1
|
||||
#define NETWORK_REGISTRATION_FLAG_ROAMING_SHOW_SPN 0x2
|
||||
|
||||
|
@ -188,9 +185,8 @@ static void set_registration_mode(struct ofono_netreg *netreg, int mode)
|
|||
path = __ofono_atom_get_path(netreg->atom);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
"Mode", DBUS_TYPE_STRING,
|
||||
&strmode);
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Mode", DBUS_TYPE_STRING, &strmode);
|
||||
}
|
||||
|
||||
static void register_callback(const struct ofono_error *error, void *data)
|
||||
|
@ -366,7 +362,7 @@ static void network_operator_emit_available_operators(struct ofono_netreg *netre
|
|||
network_operator_populate_registered(netreg, &network_operators);
|
||||
|
||||
ofono_dbus_signal_array_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"AvailableOperators",
|
||||
DBUS_TYPE_OBJECT_PATH,
|
||||
&network_operators);
|
||||
|
@ -394,7 +390,8 @@ static void set_network_operator_status(struct network_operator_data *opd,
|
|||
status_str = network_operator_status_to_string(status);
|
||||
path = network_operator_build_path(netreg, opd->mcc, opd->mnc);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path, NETWORK_OPERATOR_INTERFACE,
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
OFONO_NETWORK_OPERATOR_INTERFACE,
|
||||
"Status", DBUS_TYPE_STRING,
|
||||
&status_str);
|
||||
}
|
||||
|
@ -415,9 +412,8 @@ static void set_network_operator_techs(struct network_operator_data *opd,
|
|||
path = network_operator_build_path(netreg, opd->mcc, opd->mnc);
|
||||
|
||||
ofono_dbus_signal_array_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
"Technologies",
|
||||
DBUS_TYPE_STRING,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Technologies", DBUS_TYPE_STRING,
|
||||
&technologies);
|
||||
g_strfreev(technologies);
|
||||
}
|
||||
|
@ -498,7 +494,7 @@ static void set_network_operator_name(struct network_operator_data *opd,
|
|||
operator = get_operator_display_name(netreg);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Operator", DBUS_TYPE_STRING,
|
||||
&operator);
|
||||
}
|
||||
|
@ -509,7 +505,8 @@ static void set_network_operator_name(struct network_operator_data *opd,
|
|||
|
||||
path = network_operator_build_path(netreg, opd->mcc, opd->mnc);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path, NETWORK_OPERATOR_INTERFACE,
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
OFONO_NETWORK_OPERATOR_INTERFACE,
|
||||
"Name", DBUS_TYPE_STRING, &name);
|
||||
}
|
||||
|
||||
|
@ -543,16 +540,15 @@ static void set_network_operator_eons_info(struct network_operator_data *opd,
|
|||
|
||||
if (oldname != newname && strcmp(oldname, newname)) {
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_OPERATOR_INTERFACE,
|
||||
"Name", DBUS_TYPE_STRING,
|
||||
&newname);
|
||||
OFONO_NETWORK_OPERATOR_INTERFACE,
|
||||
"Name", DBUS_TYPE_STRING, &newname);
|
||||
|
||||
if (opd == netreg->current_operator) {
|
||||
const char *npath = __ofono_atom_get_path(netreg->atom);
|
||||
const char *operator = get_operator_display_name(netreg);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, npath,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Operator", DBUS_TYPE_STRING,
|
||||
&operator);
|
||||
}
|
||||
|
@ -570,7 +566,7 @@ static void set_network_operator_eons_info(struct network_operator_data *opd,
|
|||
|
||||
if (oldinfo != newinfo && strcmp(oldinfo, newinfo))
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_OPERATOR_INTERFACE,
|
||||
OFONO_NETWORK_OPERATOR_INTERFACE,
|
||||
"AdditionalInformation",
|
||||
DBUS_TYPE_STRING, &newinfo);
|
||||
}
|
||||
|
@ -681,7 +677,8 @@ static gboolean network_operator_dbus_register(struct ofono_netreg *netreg,
|
|||
|
||||
path = network_operator_build_path(netreg, opd->mcc, opd->mnc);
|
||||
|
||||
if (!g_dbus_register_interface(conn, path, NETWORK_OPERATOR_INTERFACE,
|
||||
if (!g_dbus_register_interface(conn, path,
|
||||
OFONO_NETWORK_OPERATOR_INTERFACE,
|
||||
network_operator_methods,
|
||||
network_operator_signals,
|
||||
NULL, opd,
|
||||
|
@ -709,7 +706,7 @@ static gboolean network_operator_dbus_unregister(struct ofono_netreg *netreg,
|
|||
path = network_operator_build_path(netreg, opd->mcc, opd->mnc);
|
||||
|
||||
return g_dbus_unregister_interface(conn, path,
|
||||
NETWORK_OPERATOR_INTERFACE);
|
||||
OFONO_NETWORK_OPERATOR_INTERFACE);
|
||||
}
|
||||
|
||||
static DBusMessage *network_get_properties(DBusConnection *conn,
|
||||
|
@ -868,7 +865,7 @@ static void set_registration_status(struct ofono_netreg *netreg, int status)
|
|||
netreg->status = status;
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Status", DBUS_TYPE_STRING,
|
||||
&str_status);
|
||||
}
|
||||
|
@ -888,7 +885,7 @@ static void set_registration_location(struct ofono_netreg *netreg, int lac)
|
|||
return;
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"LocationAreaCode",
|
||||
DBUS_TYPE_UINT16, &dbus_lac);
|
||||
}
|
||||
|
@ -905,9 +902,8 @@ static void set_registration_cellid(struct ofono_netreg *netreg, int ci)
|
|||
return;
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
"CellId", DBUS_TYPE_UINT32,
|
||||
&dbus_ci);
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"CellId", DBUS_TYPE_UINT32, &dbus_ci);
|
||||
}
|
||||
|
||||
static void set_registration_technology(struct ofono_netreg *netreg, int tech)
|
||||
|
@ -922,7 +918,7 @@ static void set_registration_technology(struct ofono_netreg *netreg, int tech)
|
|||
return;
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Technology", DBUS_TYPE_STRING,
|
||||
&tech_str);
|
||||
}
|
||||
|
@ -953,7 +949,7 @@ void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
|
|||
}
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"BaseStation", DBUS_TYPE_STRING,
|
||||
&base_station);
|
||||
}
|
||||
|
@ -1259,7 +1255,7 @@ emit:
|
|||
operator = get_operator_display_name(netreg);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Operator", DBUS_TYPE_STRING,
|
||||
&operator);
|
||||
|
||||
|
@ -1334,7 +1330,7 @@ void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength)
|
|||
dbus_uint16_t strength = netreg->signal_strength;
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Strength", DBUS_TYPE_UINT16,
|
||||
&strength);
|
||||
}
|
||||
|
@ -1452,7 +1448,7 @@ static void sim_spdi_read_cb(int ok, int length, int record,
|
|||
operator = get_operator_display_name(netreg);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Operator", DBUS_TYPE_STRING,
|
||||
&operator);
|
||||
}
|
||||
|
@ -1517,7 +1513,7 @@ static void sim_spn_read_cb(int ok, int length, int record,
|
|||
operator = get_operator_display_name(netreg);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
"Operator", DBUS_TYPE_STRING,
|
||||
&operator);
|
||||
}
|
||||
|
@ -1634,8 +1630,9 @@ static void netreg_unregister(struct ofono_atom *atom)
|
|||
}
|
||||
|
||||
g_dbus_unregister_interface(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE);
|
||||
ofono_modem_remove_interface(modem, NETWORK_REGISTRATION_INTERFACE);
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE);
|
||||
ofono_modem_remove_interface(modem,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE);
|
||||
}
|
||||
|
||||
static void netreg_remove(struct ofono_atom *atom)
|
||||
|
@ -1738,19 +1735,19 @@ void ofono_netreg_register(struct ofono_netreg *netreg)
|
|||
struct ofono_atom *sim_atom;
|
||||
|
||||
if (!g_dbus_register_interface(conn, path,
|
||||
NETWORK_REGISTRATION_INTERFACE,
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE,
|
||||
network_registration_methods,
|
||||
network_registration_signals,
|
||||
NULL, netreg, NULL)) {
|
||||
ofono_error("Could not create %s interface",
|
||||
NETWORK_REGISTRATION_INTERFACE);
|
||||
OFONO_NETWORK_REGISTRATION_INTERFACE);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
netreg->status_watches = __ofono_watchlist_new(g_free);
|
||||
|
||||
ofono_modem_add_interface(modem, NETWORK_REGISTRATION_INTERFACE);
|
||||
ofono_modem_add_interface(modem, OFONO_NETWORK_REGISTRATION_INTERFACE);
|
||||
|
||||
if (netreg->driver->registration_status)
|
||||
netreg->driver->registration_status(netreg,
|
||||
|
|
Loading…
Reference in New Issue