diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-03-12 20:00:45 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-03-12 20:00:45 +0000 |
commit | 33228f0e33468aac9aa2d155b414d8192b23b0f3 (patch) | |
tree | 1b8fe089ecc482ff9c68cc227fc413dff23e7c0c | |
parent | cf826d7c14f2587e96815dc714739be161e98d80 (diff) |
Emit PropertyChanged when property changes in adapter.
-rw-r--r-- | hcid/adapter.c | 9 | ||||
-rw-r--r-- | hcid/dbus-hci.c | 27 |
2 files changed, 36 insertions, 0 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c index e2e22548..8c7c53f5 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -730,6 +730,11 @@ static DBusHandlerResult set_discoverable_timeout(DBusConnection *conn, DBUS_TYPE_UINT32, &timeout, DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(conn, dbus_message_get_path(msg), + ADAPTER_INTERFACE, + "DiscoverableTimeout", + DBUS_TYPE_UINT32, &timeout); + return send_message_and_unref(conn, reply); } @@ -1143,6 +1148,10 @@ done: if (!reply) return DBUS_HANDLER_RESULT_NEED_MEMORY; + dbus_connection_emit_property_changed(conn, dbus_message_get_path(msg), + ADAPTER_INTERFACE, "Name", + DBUS_TYPE_STRING, &name); + return send_message_and_unref(conn, reply); } diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index 69c289d6..92aed10f 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -312,6 +312,10 @@ static void adapter_mode_changed(struct adapter *adapter, "ModeChanged", DBUS_TYPE_STRING, &mode, DBUS_TYPE_INVALID); + + dbus_connection_emit_property_changed(connection, path, + ADAPTER_INTERFACE, "Mode", + DBUS_TYPE_STRING, &mode); } /* @@ -673,6 +677,10 @@ int hcid_dbus_start_device(uint16_t id) DBUS_TYPE_STRING, &mode, DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(connection, path, + ADAPTER_INTERFACE, "Mode", + DBUS_TYPE_STRING, &mode); + if (get_default_adapter() < 0) { set_default_adapter(id); pptr = path; @@ -786,6 +794,10 @@ int hcid_dbus_stop_device(uint16_t id) DBUS_TYPE_STRING, &mode, DBUS_TYPE_INVALID); + dbus_connection_emit_property_changed(connection, path, + ADAPTER_INTERFACE, "Mode", + DBUS_TYPE_STRING, &mode); + adapter->up = 0; adapter->scan_enable = SCAN_DISABLED; adapter->mode = MODE_OFF; @@ -974,6 +986,11 @@ void hcid_dbus_inquiry_start(bdaddr_t *local) /* Disable name resolution for non D-Bus clients */ if (!adapter->discov_requestor) adapter->discov_type &= ~RESOLVE_NAME; + + dbus_connection_emit_property_changed(connection, path, + ADAPTER_INTERFACE, "PeriodicDiscovery", + DBUS_TYPE_BOOLEAN, + &adapter->discov_active); } send_adapter_signal(connection, adapter->dev_id, "DiscoveryStarted", @@ -1221,6 +1238,11 @@ void hcid_dbus_periodic_inquiry_start(bdaddr_t *local, uint8_t status) /* Disable name resolution for non D-Bus clients */ if (!adapter->pdiscov_requestor) adapter->discov_type &= ~RESOLVE_NAME; + + dbus_connection_emit_property_changed(connection, path, + ADAPTER_INTERFACE, "PeriodicDiscovery", + DBUS_TYPE_BOOLEAN, + &adapter->discov_active); } dbus_connection_emit_signal(connection, path, ADAPTER_INTERFACE, @@ -1291,6 +1313,11 @@ void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status) dbus_connection_emit_signal(connection, path, ADAPTER_INTERFACE, "PeriodicDiscoveryStopped", DBUS_TYPE_INVALID); + + dbus_connection_emit_property_changed(connection, path, + ADAPTER_INTERFACE, "PeriodicDiscovery", + DBUS_TYPE_BOOLEAN, + &adapter->discov_active); } static char *extract_eir_name(uint8_t *data, uint8_t *type) |