mirror of git://git.sysmocom.de/ofono
handsfree: Implement inband ring settings
This commit is contained in:
parent
f9fba08432
commit
6072a98109
|
@ -43,17 +43,38 @@
|
||||||
static GSList *g_drivers = NULL;
|
static GSList *g_drivers = NULL;
|
||||||
|
|
||||||
struct ofono_handsfree {
|
struct ofono_handsfree {
|
||||||
|
ofono_bool_t inband_ringing;
|
||||||
const struct ofono_handsfree_driver *driver;
|
const struct ofono_handsfree_driver *driver;
|
||||||
void *driver_data;
|
void *driver_data;
|
||||||
struct ofono_atom *atom;
|
struct ofono_atom *atom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
|
||||||
|
ofono_bool_t enabled)
|
||||||
|
{
|
||||||
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
|
const char *path = __ofono_atom_get_path(hf->atom);
|
||||||
|
dbus_bool_t dbus_enabled = enabled;
|
||||||
|
|
||||||
|
if (hf->inband_ringing == enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
hf->inband_ringing = enabled;
|
||||||
|
|
||||||
|
ofono_dbus_signal_property_changed(conn, path,
|
||||||
|
OFONO_HANDSFREE_INTERFACE,
|
||||||
|
"InbandRinging", DBUS_TYPE_BOOLEAN,
|
||||||
|
&dbus_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
static DBusMessage *handsfree_get_properties(DBusConnection *conn,
|
static DBusMessage *handsfree_get_properties(DBusConnection *conn,
|
||||||
DBusMessage *msg, void *data)
|
DBusMessage *msg, void *data)
|
||||||
{
|
{
|
||||||
|
struct ofono_handsfree *hf = data;
|
||||||
DBusMessage *reply;
|
DBusMessage *reply;
|
||||||
DBusMessageIter iter;
|
DBusMessageIter iter;
|
||||||
DBusMessageIter dict;
|
DBusMessageIter dict;
|
||||||
|
dbus_bool_t inband_ringing;
|
||||||
|
|
||||||
reply = dbus_message_new_method_return(msg);
|
reply = dbus_message_new_method_return(msg);
|
||||||
if (reply == NULL)
|
if (reply == NULL)
|
||||||
|
@ -64,6 +85,11 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn,
|
||||||
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
|
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
|
||||||
OFONO_PROPERTIES_ARRAY_SIGNATURE,
|
OFONO_PROPERTIES_ARRAY_SIGNATURE,
|
||||||
&dict);
|
&dict);
|
||||||
|
|
||||||
|
inband_ringing = hf->inband_ringing;
|
||||||
|
ofono_dbus_dict_append(&dict, "InbandRinging", DBUS_TYPE_BOOLEAN,
|
||||||
|
&inband_ringing);
|
||||||
|
|
||||||
dbus_message_iter_close_container(&iter, &dict);
|
dbus_message_iter_close_container(&iter, &dict);
|
||||||
|
|
||||||
return reply;
|
return reply;
|
||||||
|
|
Loading…
Reference in New Issue