mirror of git://git.sysmocom.de/ofono
Move CALL_FORWARDING_INTERFACE define to dbus.h
This commit is contained in:
parent
ae4ea4cd5e
commit
f82b9a32fd
|
@ -33,6 +33,8 @@ extern "C" {
|
||||||
#define OFONO_MANAGER_PATH "/"
|
#define OFONO_MANAGER_PATH "/"
|
||||||
#define OFONO_MODEM_INTERFACE "org.ofono.Modem"
|
#define OFONO_MODEM_INTERFACE "org.ofono.Modem"
|
||||||
#define OFONO_CALL_BARRING_INTERFACE "org.ofono.CallBarring"
|
#define OFONO_CALL_BARRING_INTERFACE "org.ofono.CallBarring"
|
||||||
|
#define OFONO_CALL_FORWARDING_INTERFACE "org.ofono.CallForwarding"
|
||||||
|
|
||||||
|
|
||||||
/* Essentially a{sv} */
|
/* Essentially a{sv} */
|
||||||
#define OFONO_PROPERTIES_ARRAY_SIGNATURE DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
|
#define OFONO_PROPERTIES_ARRAY_SIGNATURE DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "ussd.h"
|
#include "ussd.h"
|
||||||
|
|
||||||
#define CALL_FORWARDING_INTERFACE "org.ofono.CallForwarding"
|
|
||||||
|
|
||||||
#define CALL_FORWARDING_FLAG_CACHED 0x1
|
#define CALL_FORWARDING_FLAG_CACHED 0x1
|
||||||
|
|
||||||
/* According to 27.007 Spec */
|
/* According to 27.007 Spec */
|
||||||
|
@ -238,14 +236,14 @@ static void set_new_cond_list(struct ofono_call_forwarding *cf,
|
||||||
strcmp(oc->phone_number.number,
|
strcmp(oc->phone_number.number,
|
||||||
lc->phone_number.number))
|
lc->phone_number.number))
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE,
|
OFONO_CALL_FORWARDING_INTERFACE,
|
||||||
attr, DBUS_TYPE_STRING,
|
attr, DBUS_TYPE_STRING,
|
||||||
&number);
|
&number);
|
||||||
|
|
||||||
if (type == CALL_FORWARDING_TYPE_NO_REPLY &&
|
if (type == CALL_FORWARDING_TYPE_NO_REPLY &&
|
||||||
oc->time != lc->time)
|
oc->time != lc->time)
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE,
|
OFONO_CALL_FORWARDING_INTERFACE,
|
||||||
tattr, DBUS_TYPE_UINT16,
|
tattr, DBUS_TYPE_UINT16,
|
||||||
&timeout);
|
&timeout);
|
||||||
|
|
||||||
|
@ -256,14 +254,14 @@ static void set_new_cond_list(struct ofono_call_forwarding *cf,
|
||||||
number = phone_number_to_string(&lc->phone_number);
|
number = phone_number_to_string(&lc->phone_number);
|
||||||
|
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE,
|
OFONO_CALL_FORWARDING_INTERFACE,
|
||||||
attr, DBUS_TYPE_STRING,
|
attr, DBUS_TYPE_STRING,
|
||||||
&number);
|
&number);
|
||||||
|
|
||||||
if (type == CALL_FORWARDING_TYPE_NO_REPLY &&
|
if (type == CALL_FORWARDING_TYPE_NO_REPLY &&
|
||||||
lc->time != DEFAULT_NO_REPLY_TIMEOUT)
|
lc->time != DEFAULT_NO_REPLY_TIMEOUT)
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE,
|
OFONO_CALL_FORWARDING_INTERFACE,
|
||||||
tattr, DBUS_TYPE_UINT16,
|
tattr, DBUS_TYPE_UINT16,
|
||||||
&timeout);
|
&timeout);
|
||||||
}
|
}
|
||||||
|
@ -282,13 +280,13 @@ static void set_new_cond_list(struct ofono_call_forwarding *cf,
|
||||||
sprintf(tattr, "%sTimeout", attr);
|
sprintf(tattr, "%sTimeout", attr);
|
||||||
|
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE, attr,
|
OFONO_CALL_FORWARDING_INTERFACE, attr,
|
||||||
DBUS_TYPE_STRING, &number);
|
DBUS_TYPE_STRING, &number);
|
||||||
|
|
||||||
if (type == CALL_FORWARDING_TYPE_NO_REPLY &&
|
if (type == CALL_FORWARDING_TYPE_NO_REPLY &&
|
||||||
oc->time != DEFAULT_NO_REPLY_TIMEOUT)
|
oc->time != DEFAULT_NO_REPLY_TIMEOUT)
|
||||||
ofono_dbus_signal_property_changed(conn, path,
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE,
|
OFONO_CALL_FORWARDING_INTERFACE,
|
||||||
tattr, DBUS_TYPE_UINT16,
|
tattr, DBUS_TYPE_UINT16,
|
||||||
&timeout);
|
&timeout);
|
||||||
}
|
}
|
||||||
|
@ -1115,8 +1113,9 @@ static void call_forwarding_unregister(struct ofono_atom *atom)
|
||||||
DBusConnection *conn = ofono_dbus_get_connection();
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
struct ofono_modem *modem = __ofono_atom_get_modem(cf->atom);
|
struct ofono_modem *modem = __ofono_atom_get_modem(cf->atom);
|
||||||
|
|
||||||
ofono_modem_remove_interface(modem, CALL_FORWARDING_INTERFACE);
|
ofono_modem_remove_interface(modem, OFONO_CALL_FORWARDING_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, path, CALL_FORWARDING_INTERFACE);
|
g_dbus_unregister_interface(conn, path,
|
||||||
|
OFONO_CALL_FORWARDING_INTERFACE);
|
||||||
|
|
||||||
cf_unregister_ss_controls(cf);
|
cf_unregister_ss_controls(cf);
|
||||||
|
|
||||||
|
@ -1182,18 +1181,18 @@ void ofono_call_forwarding_register(struct ofono_call_forwarding *cf)
|
||||||
struct ofono_modem *modem = __ofono_atom_get_modem(cf->atom);
|
struct ofono_modem *modem = __ofono_atom_get_modem(cf->atom);
|
||||||
|
|
||||||
if (!g_dbus_register_interface(conn, path,
|
if (!g_dbus_register_interface(conn, path,
|
||||||
CALL_FORWARDING_INTERFACE,
|
OFONO_CALL_FORWARDING_INTERFACE,
|
||||||
cf_methods, cf_signals, NULL, cf,
|
cf_methods, cf_signals, NULL, cf,
|
||||||
NULL)) {
|
NULL)) {
|
||||||
ofono_error("Could not create %s interface",
|
ofono_error("Could not create %s interface",
|
||||||
CALL_FORWARDING_INTERFACE);
|
OFONO_CALL_FORWARDING_INTERFACE);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
modem->call_forwarding = cf;
|
modem->call_forwarding = cf;
|
||||||
|
|
||||||
ofono_modem_add_interface(modem, CALL_FORWARDING_INTERFACE);
|
ofono_modem_add_interface(modem, OFONO_CALL_FORWARDING_INTERFACE);
|
||||||
cf_register_ss_controls(cf);
|
cf_register_ss_controls(cf);
|
||||||
|
|
||||||
__ofono_atom_register(cf->atom, call_forwarding_unregister);
|
__ofono_atom_register(cf->atom, call_forwarding_unregister);
|
||||||
|
|
Loading…
Reference in New Issue