summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-16 22:03:25 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-16 22:03:25 +0300
commitc0736ea762bfea95e98c8b9f118b4e5464f2159c (patch)
tree1bd3bb6859eccd4ea71dc300b34104496e01cf7c
parent3a11e84a573785024b11d89ed4f9b06e43b06ca6 (diff)
Rename dbus_connection_emit_property_changed to emit_property_changed
-rw-r--r--audio/control.c16
-rw-r--r--audio/headset.c20
-rw-r--r--audio/sink.c34
-rw-r--r--input/device.c10
-rw-r--r--network/connection.c42
-rw-r--r--src/adapter.c71
-rw-r--r--src/dbus-common.c10
-rw-r--r--src/dbus-common.h10
-rw-r--r--src/dbus-hci.c19
-rw-r--r--src/device.c28
10 files changed, 112 insertions, 148 deletions
diff --git a/audio/control.c b/audio/control.c
index 849af932..a7cea16a 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -425,11 +425,9 @@ static void avctp_unref(struct avctp *session)
AUDIO_CONTROL_INTERFACE,
"Disconnected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(session->dev->conn,
- session->dev->path,
- AUDIO_CONTROL_INTERFACE,
- "Connected",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(session->dev->conn, session->dev->path,
+ AUDIO_CONTROL_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &value);
}
if (session->sock >= 0)
@@ -627,11 +625,9 @@ static gboolean avctp_connect_session(struct avctp *session)
g_dbus_emit_signal(session->dev->conn, session->dev->path,
AUDIO_CONTROL_INTERFACE, "Connected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(session->dev->conn,
- session->dev->path,
- AUDIO_CONTROL_INTERFACE,
- "Connected",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(session->dev->conn, session->dev->path,
+ AUDIO_CONTROL_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &value);
if (session->io)
g_source_remove(session->io);
diff --git a/audio/headset.c b/audio/headset.c
index 5f6f00f0..cb0fa9a3 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -885,7 +885,7 @@ static int signal_gain_setting(struct audio_device *device, const char *buf)
DBUS_TYPE_UINT16, &gain,
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(device->conn, device->path,
+ emit_property_changed(device->conn, device->path,
AUDIO_HEADSET_INTERFACE, property,
DBUS_TYPE_UINT16, &gain);
@@ -2219,10 +2219,9 @@ void headset_set_state(struct audio_device *dev, headset_state_t state)
AUDIO_HEADSET_INTERFACE,
"Disconnected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn, dev->path,
- AUDIO_HEADSET_INTERFACE,
- "Connected",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(dev->conn, dev->path,
+ AUDIO_HEADSET_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &value);
telephony_device_disconnected(dev);
active_devices = g_slist_remove(active_devices, dev);
break;
@@ -2236,7 +2235,7 @@ void headset_set_state(struct audio_device *dev, headset_state_t state)
AUDIO_HEADSET_INTERFACE,
"Connected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn, dev->path,
+ emit_property_changed(dev->conn, dev->path,
AUDIO_HEADSET_INTERFACE,
"Connected",
DBUS_TYPE_BOOLEAN, &value);
@@ -2248,7 +2247,7 @@ void headset_set_state(struct audio_device *dev, headset_state_t state)
AUDIO_HEADSET_INTERFACE,
"Stopped",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn, dev->path,
+ emit_property_changed(dev->conn, dev->path,
AUDIO_HEADSET_INTERFACE,
"Playing",
DBUS_TYPE_BOOLEAN, &value);
@@ -2265,10 +2264,9 @@ void headset_set_state(struct audio_device *dev, headset_state_t state)
g_dbus_emit_signal(dev->conn, dev->path,
AUDIO_HEADSET_INTERFACE,
"Playing", DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn, dev->path,
- AUDIO_HEADSET_INTERFACE,
- "Playing",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(dev->conn, dev->path,
+ AUDIO_HEADSET_INTERFACE, "Playing",
+ DBUS_TYPE_BOOLEAN, &value);
if (hs->sp_gain >= 0)
headset_send(hs, "\r\n+VGS=%u\r\n", hs->sp_gain);
diff --git a/audio/sink.c b/audio/sink.c
index a1034c1a..a2dfd69e 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -91,10 +91,9 @@ static void stream_state_changed(struct avdtp_stream *stream,
AUDIO_SINK_INTERFACE,
"Disconnected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn, dev->path,
- AUDIO_SINK_INTERFACE,
- "Connected",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(dev->conn, dev->path,
+ AUDIO_SINK_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &value);
if (sink->disconnect) {
DBusMessage *reply;
struct pending_request *p;
@@ -122,24 +121,20 @@ static void stream_state_changed(struct avdtp_stream *stream,
AUDIO_SINK_INTERFACE,
"Connected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn,
- dev->path,
- AUDIO_SINK_INTERFACE,
- "Connected",
- DBUS_TYPE_BOOLEAN,
- &value);
+ emit_property_changed(dev->conn, dev->path,
+ AUDIO_SINK_INTERFACE,
+ "Connected",
+ DBUS_TYPE_BOOLEAN, &value);
} else if (old_state == AVDTP_STATE_STREAMING) {
value = FALSE;
g_dbus_emit_signal(dev->conn, dev->path,
AUDIO_SINK_INTERFACE,
"Stopped",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn,
- dev->path,
- AUDIO_SINK_INTERFACE,
- "Playing",
- DBUS_TYPE_BOOLEAN,
- &value);
+ emit_property_changed(dev->conn, dev->path,
+ AUDIO_SINK_INTERFACE,
+ "Playing",
+ DBUS_TYPE_BOOLEAN, &value);
}
break;
case AVDTP_STATE_STREAMING:
@@ -148,10 +143,9 @@ static void stream_state_changed(struct avdtp_stream *stream,
AUDIO_SINK_INTERFACE,
"Playing",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(dev->conn, dev->path,
- AUDIO_SINK_INTERFACE,
- "Playing",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(dev->conn, dev->path,
+ AUDIO_SINK_INTERFACE, "Playing",
+ DBUS_TYPE_BOOLEAN, &value);
break;
case AVDTP_STATE_CONFIGURED:
case AVDTP_STATE_CLOSING:
diff --git a/input/device.c b/input/device.c
index bf82c5de..af118bfa 100644
--- a/input/device.c
+++ b/input/device.c
@@ -409,9 +409,8 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data
g_dbus_emit_signal(idev->conn, idev->path,
INPUT_DEVICE_INTERFACE, "Disconnected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(idev->conn, idev->path,
- INPUT_DEVICE_INTERFACE, "Connected",
- DBUS_TYPE_BOOLEAN, &connected);
+ emit_property_changed(idev->conn, idev->path, INPUT_DEVICE_INTERFACE,
+ "Connected", DBUS_TYPE_BOOLEAN, &connected);
g_source_remove(iconn->ctrl_watch);
iconn->ctrl_watch = 0;
@@ -1253,9 +1252,8 @@ int input_device_connadd(const bdaddr_t *src, const bdaddr_t *dst)
g_dbus_emit_signal(idev->conn, idev->path,
INPUT_DEVICE_INTERFACE, "Connected",
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(idev->conn, idev->path,
- INPUT_DEVICE_INTERFACE, "Connected",
- DBUS_TYPE_BOOLEAN, &connected);
+ emit_property_changed(idev->conn, idev->path, INPUT_DEVICE_INTERFACE,
+ "Connected", DBUS_TYPE_BOOLEAN, &connected);
return 0;
diff --git a/network/connection.c b/network/connection.c
index 6d6ddd03..ed667086 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -143,21 +143,15 @@ static gboolean bnep_watchdog_cb(GIOChannel *chan, GIOCondition cond,
NETWORK_PEER_INTERFACE, "Disconnected",
DBUS_TYPE_STRING, &device,
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(connection,
- nc->peer->path,
- NETWORK_PEER_INTERFACE,
- "Connected",
- DBUS_TYPE_BOOLEAN, &connected);
- dbus_connection_emit_property_changed(connection,
- nc->peer->path,
- NETWORK_PEER_INTERFACE,
- "Device",
- DBUS_TYPE_STRING, &property);
- dbus_connection_emit_property_changed(connection,
- nc->peer->path,
- NETWORK_PEER_INTERFACE,
- "UUID",
- DBUS_TYPE_STRING, &property);
+ emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
+ emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "Device",
+ DBUS_TYPE_STRING, &property);
+ emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "UUID",
+ DBUS_TYPE_STRING, &property);
}
info("%s disconnected", nc->dev);
@@ -253,15 +247,15 @@ static gboolean bnep_connect_cb(GIOChannel *chan, GIOCondition cond,
DBUS_TYPE_STRING, &pdev,
DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INVALID);
- dbus_connection_emit_property_changed(connection, nc->peer->path,
- NETWORK_PEER_INTERFACE, "Connected",
- DBUS_TYPE_BOOLEAN, &connected);
- dbus_connection_emit_property_changed(connection, nc->peer->path,
- NETWORK_PEER_INTERFACE, "Device",
- DBUS_TYPE_BOOLEAN, &pdev);
- dbus_connection_emit_property_changed(connection, nc->peer->path,
- NETWORK_PEER_INTERFACE, "UUID",
- DBUS_TYPE_BOOLEAN, &uuid);
+ emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "Connected",
+ DBUS_TYPE_BOOLEAN, &connected);
+ emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "Device",
+ DBUS_TYPE_BOOLEAN, &pdev);
+ emit_property_changed(connection, nc->peer->path,
+ NETWORK_PEER_INTERFACE, "UUID",
+ DBUS_TYPE_BOOLEAN, &uuid);
nc->state = CONNECTED;
diff --git a/src/adapter.c b/src/adapter.c
index f0b60d49..24f0b3ae 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -823,10 +823,9 @@ static DBusMessage *set_discoverable_timeout(DBusConnection *conn,
path = dbus_message_get_path(msg);
- dbus_connection_emit_property_changed(conn, path,
- ADAPTER_INTERFACE,
- "DiscoverableTimeout",
- DBUS_TYPE_UINT32, &timeout);
+ emit_property_changed(conn, path,
+ ADAPTER_INTERFACE, "DiscoverableTimeout",
+ DBUS_TYPE_UINT32, &timeout);
return dbus_message_new_method_return(msg);
}
@@ -902,10 +901,8 @@ static DBusMessage *set_name(DBusConnection *conn, DBusMessage *msg,
path = dbus_message_get_path(msg);
- dbus_connection_emit_property_changed(conn, path,
- ADAPTER_INTERFACE,
- "Name", DBUS_TYPE_STRING,
- &name);
+ emit_property_changed(conn, path, ADAPTER_INTERFACE, "Name",
+ DBUS_TYPE_STRING, &name);
return dbus_message_new_method_return(msg);
}
@@ -1033,9 +1030,8 @@ static DBusMessage *remove_bonding(DBusConnection *conn, DBusMessage *msg,
const gchar *dev_path = device_get_path(device);
- dbus_connection_emit_property_changed(conn, dev_path,
- DEVICE_INTERFACE, "Paired",
- DBUS_TYPE_BOOLEAN, &paired);
+ emit_property_changed(conn, dev_path, DEVICE_INTERFACE,
+ "Paired", DBUS_TYPE_BOOLEAN, &paired);
}
proceed:
@@ -2434,22 +2430,20 @@ static void adapter_up(struct btd_adapter *adapter, int dd)
pmode = mode2str(adapter->mode);
- dbus_connection_emit_property_changed(connection, adapter->path,
- ADAPTER_INTERFACE, "Mode",
- DBUS_TYPE_STRING, &pmode);
+ emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE,
+ "Mode", DBUS_TYPE_STRING, &pmode);
powered = adapter->scan_mode == SCAN_DISABLED ? FALSE : TRUE;
- dbus_connection_emit_property_changed(connection, adapter->path,
- ADAPTER_INTERFACE, "Powered",
- DBUS_TYPE_BOOLEAN, &powered);
+ emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE,
+ "Powered", DBUS_TYPE_BOOLEAN, &powered);
discoverable = adapter->scan_mode == (SCAN_PAGE | SCAN_INQUIRY) ? TRUE
: FALSE;
- dbus_connection_emit_property_changed(connection, adapter->path,
- ADAPTER_INTERFACE, "Discoverable",
- DBUS_TYPE_BOOLEAN, &discoverable);
+ emit_property_changed(connection, adapter->path,
+ ADAPTER_INTERFACE, "Discoverable",
+ DBUS_TYPE_BOOLEAN, &discoverable);
load_drivers(adapter);
load_devices(adapter);
@@ -2663,20 +2657,18 @@ int adapter_stop(struct btd_adapter *adapter)
adapter->active_conn = NULL;
}
- dbus_connection_emit_property_changed(connection, adapter->path,
- ADAPTER_INTERFACE, "Mode",
- DBUS_TYPE_STRING, &mode);
+ emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE,
+ "Mode", DBUS_TYPE_STRING, &mode);
powered = FALSE;
- dbus_connection_emit_property_changed(connection, adapter->path,
- ADAPTER_INTERFACE, "Powered",
- DBUS_TYPE_BOOLEAN, &powered);
+ emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE,
+ "Powered", DBUS_TYPE_BOOLEAN, &powered);
if (adapter->scan_mode == (SCAN_PAGE | SCAN_INQUIRY)) {
discoverable = FALSE;
- dbus_connection_emit_property_changed(connection, adapter->path,
+ emit_property_changed(connection, adapter->path,
ADAPTER_INTERFACE, "Discoverable",
DBUS_TYPE_BOOLEAN, &discoverable);
}
@@ -2952,7 +2944,7 @@ void adapter_set_state(struct btd_adapter *adapter, int state)
adapter->oor_devices = NULL;
}
- dbus_connection_emit_property_changed(connection, path,
+ emit_property_changed(connection, path,
ADAPTER_INTERFACE, "Discovering",
DBUS_TYPE_BOOLEAN, &discov_active);
@@ -3125,19 +3117,18 @@ void adapter_mode_changed(struct btd_adapter *adapter, uint8_t scan_mode)
return;
}
- dbus_connection_emit_property_changed(connection, path,
- ADAPTER_INTERFACE, "Mode",
- DBUS_TYPE_STRING, &mode);
+ emit_property_changed(connection, path, ADAPTER_INTERFACE, "Mode",
+ DBUS_TYPE_STRING, &mode);
if (powered == FALSE || adapter->scan_mode == SCAN_DISABLED) {
- dbus_connection_emit_property_changed(connection, path,
- ADAPTER_INTERFACE, "Powered",
- DBUS_TYPE_BOOLEAN, &powered);
+ emit_property_changed(connection, path,
+ ADAPTER_INTERFACE, "Powered",
+ DBUS_TYPE_BOOLEAN, &powered);
}
- dbus_connection_emit_property_changed(connection, path,
- ADAPTER_INTERFACE, "Discoverable",
- DBUS_TYPE_BOOLEAN, &discoverable);
+ emit_property_changed(connection, path,
+ ADAPTER_INTERFACE, "Discoverable",
+ DBUS_TYPE_BOOLEAN, &discoverable);
adapter_set_scan_mode(adapter, scan_mode);
}
@@ -3378,8 +3369,8 @@ void adapter_update_devices(struct btd_adapter *adapter)
devices[i] = (char *) device_get_path(dev);
}
- dbus_connection_emit_property_changed(connection, adapter->path,
- ADAPTER_INTERFACE, "Devices",
- DBUS_TYPE_ARRAY, &devices);
+ emit_property_changed(connection, adapter->path,
+ ADAPTER_INTERFACE, "Devices",
+ DBUS_TYPE_ARRAY, &devices);
g_free(devices);
}
diff --git a/src/dbus-common.c b/src/dbus-common.c
index fdf384f2..89deccbf 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -347,11 +347,11 @@ void dict_append_array(DBusMessageIter *dict, const char *key, int type,
dbus_message_iter_close_container(dict, &entry);
}
-dbus_bool_t dbus_connection_emit_property_changed(DBusConnection *conn,
- const char *path,
- const char *interface,
- const char *name,
- int type, void *value)
+dbus_bool_t emit_property_changed(DBusConnection *conn,
+ const char *path,
+ const char *interface,
+ const char *name,
+ int type, void *value)
{
DBusMessage *signal;
DBusMessageIter iter;
diff --git a/src/dbus-common.h b/src/dbus-common.h
index 83f77191..3b758b9d 100644
--- a/src/dbus-common.h
+++ b/src/dbus-common.h
@@ -35,8 +35,8 @@ void dict_append_entry(DBusMessageIter *dict,
void dict_append_array(DBusMessageIter *dict, const char *key, int type,
void *val, int n_elements);
-dbus_bool_t dbus_connection_emit_property_changed(DBusConnection *conn,
- const char *path,
- const char *interface,
- const char *name,
- int type, void *value);
+dbus_bool_t emit_property_changed(DBusConnection *conn,
+ const char *path,
+ const char *interface,
+ const char *name,
+ int type, void *value);
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 36aca477..9ee2e09b 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -1028,8 +1028,7 @@ void hcid_dbus_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class)
dev_path = device_get_path(device);
- dbus_connection_emit_property_changed(connection, dev_path,
- DEVICE_INTERFACE, "Class",
+ emit_property_changed(connection, dev_path, DEVICE_INTERFACE, "Class",
DBUS_TYPE_UINT32, &class);
}
@@ -1059,17 +1058,15 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,
dev_path = device_get_path(device);
- dbus_connection_emit_property_changed(connection,
- dev_path, DEVICE_INTERFACE,
- "Name", DBUS_TYPE_STRING, &name);
+ emit_property_changed(connection, dev_path,
+ DEVICE_INTERFACE, "Name",
+ DBUS_TYPE_STRING, &name);
if (read_device_alias(srcaddr, dstaddr,
- alias, sizeof(alias)) < 1) {
-
- dbus_connection_emit_property_changed(connection,
- dev_path, DEVICE_INTERFACE,
- "Alias", DBUS_TYPE_STRING, &name);
- }
+ alias, sizeof(alias)) < 1)
+ emit_property_changed(connection, dev_path,
+ DEVICE_INTERFACE, "Alias",
+ DBUS_TYPE_STRING, &name);
}
}
diff --git a/src/device.c b/src/device.c
index 80d655f3..df9306eb 100644
--- a/src/device.c
+++ b/src/device.c
@@ -287,9 +287,9 @@ static DBusMessage *set_alias(DBusConnection *conn, DBusMessage *msg,
ERROR_INTERFACE ".Failed",
strerror(-err));
- dbus_connection_emit_property_changed(conn, dbus_message_get_path(msg),
- DEVICE_INTERFACE, "Alias",
- DBUS_TYPE_STRING, &alias);
+ emit_property_changed(conn, dbus_message_get_path(msg),
+ DEVICE_INTERFACE, "Alias",
+ DBUS_TYPE_STRING, &alias);
return dbus_message_new_method_return(msg);
}
@@ -309,9 +309,9 @@ static DBusMessage *set_trust(DBusConnection *conn, DBusMessage *msg,
write_trust(srcaddr, dstaddr, GLOBAL_TRUST, value);
- dbus_connection_emit_property_changed(conn, dbus_message_get_path(msg),
- DEVICE_INTERFACE, "Trusted",
- DBUS_TYPE_BOOLEAN, &value);
+ emit_property_changed(conn, dbus_message_get_path(msg),
+ DEVICE_INTERFACE, "Trusted",
+ DBUS_TYPE_BOOLEAN, &value);
return dbus_message_new_method_return(msg);
}
@@ -526,10 +526,8 @@ void device_set_connected(DBusConnection *conn, struct btd_device *device,
{
device->connected = connected;
- dbus_connection_emit_property_changed(conn, device->path,
- DEVICE_INTERFACE,
- "Connected", DBUS_TYPE_BOOLEAN,
- &connected);
+ emit_property_changed(conn, device->path, DEVICE_INTERFACE,
+ "Connected", DBUS_TYPE_BOOLEAN, &connected);
if (connected && device->secmode3) {
struct btd_adapter *adapter = device_get_adapter(device);
@@ -830,9 +828,8 @@ static void services_changed(struct btd_device *device)
for (i = 0, l = device->uuids; l; l = l->next, i++)
uuids[i] = l->data;
- dbus_connection_emit_property_changed(conn, device->path,
- DEVICE_INTERFACE, "UUIDs",
- DBUS_TYPE_ARRAY, &uuids);
+ emit_property_changed(conn, device->path, DEVICE_INTERFACE, "UUIDs",
+ DBUS_TYPE_ARRAY, &uuids);
g_free(uuids);
}
@@ -1301,9 +1298,8 @@ int device_set_paired(DBusConnection *conn, struct btd_device *device,
device_set_temporary(device, FALSE);
- dbus_connection_emit_property_changed(conn, device->path,
- DEVICE_INTERFACE, "Paired",
- DBUS_TYPE_BOOLEAN, &paired);
+ emit_property_changed(conn, device->path, DEVICE_INTERFACE, "Paired",
+ DBUS_TYPE_BOOLEAN, &paired);
/* If we were initiators start service discovery immediately.
* However if the other end was the initator wait a few seconds