From: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx> --- doc/adapter-api.txt | 10 ---------- src/adapter.c | 35 ----------------------------------- test/test-attrib | 2 +- test/test-device | 2 +- test/test-health | 2 +- test/test-health-sink | 2 +- 6 files changed, 4 insertions(+), 49 deletions(-) diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt index 916e941..176843b 100644 --- a/doc/adapter-api.txt +++ b/doc/adapter-api.txt @@ -88,16 +88,6 @@ Methods dict GetProperties() Possible Errors: org.bluez.Error.DoesNotExist org.bluez.Error.InvalidArguments - array{object} ListDevices() {deprecated} - - Returns list of device object paths. - This method is deprecated, instead use the Devices - Property to get the list of devices object paths. - - Possible errors: org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - org.bluez.Error.OutOfMemory - object CreateDevice(string address) Creates a new object path for a remote device. This diff --git a/src/adapter.c b/src/adapter.c index eeba44d..a043366 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1307,38 +1307,6 @@ static DBusMessage *release_session(DBusConnection *conn, return dbus_message_new_method_return(msg); } -static DBusMessage *list_devices(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - DBusMessage *reply; - GSList *l; - DBusMessageIter iter; - DBusMessageIter array_iter; - const gchar *dev_path; - - reply = dbus_message_new_method_return(msg); - if (!reply) - return NULL; - - dbus_message_iter_init_append(reply, &iter); - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_OBJECT_PATH_AS_STRING, &array_iter); - - for (l = adapter->devices; l; l = l->next) { - struct btd_device *device = l->data; - - dev_path = device_get_path(device); - - dbus_message_iter_append_basic(&array_iter, - DBUS_TYPE_OBJECT_PATH, &dev_path); - } - - dbus_message_iter_close_container(&iter, &array_iter); - - return reply; -} - static DBusMessage *cancel_device_creation(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -1662,9 +1630,6 @@ static const GDBusMethodTable adapter_methods[] = { adapter_start_discovery) }, { GDBUS_ASYNC_METHOD("StopDiscovery", NULL, NULL, adapter_stop_discovery) }, - { GDBUS_DEPRECATED_METHOD("ListDevices", - NULL, GDBUS_ARGS({ "devices", "ao" }), - list_devices) }, { GDBUS_ASYNC_METHOD("CreateDevice", GDBUS_ARGS({ "address", "s" }), GDBUS_ARGS({ "device", "o" }), diff --git a/test/test-attrib b/test/test-attrib index 52b399c..f83859d 100755 --- a/test/test-attrib +++ b/test/test-attrib @@ -46,7 +46,7 @@ if (len(args) < 1): sys.exit(1) if (args[0] == "list"): - for path in adapter.ListDevices(): + for path in adapter.GetProperties()["Devices"]: device = dbus.Interface(bus.get_object("org.bluez", path), "org.bluez.Device") devprop = device.GetProperties() diff --git a/test/test-device b/test/test-device index 81a44f8..63a96d3 100755 --- a/test/test-device +++ b/test/test-device @@ -49,7 +49,7 @@ if (len(args) < 1): sys.exit(1) if (args[0] == "list"): - for path in adapter.ListDevices(): + for path in adapter.GetProperties()["Devices"]: device = dbus.Interface(bus.get_object("org.bluez", path), "org.bluez.Device") properties = device.GetProperties() diff --git a/test/test-health b/test/test-health index f7d4241..307e880 100755 --- a/test/test-health +++ b/test/test-health @@ -157,7 +157,7 @@ while select == None: adapter = dbus.Interface(bus.get_object("org.bluez", select), "org.bluez.Adapter") -devices = adapter.ListDevices() +devices = adapter.GetProperties()["Devices"] if len(devices) == 0: print("No devices available") diff --git a/test/test-health-sink b/test/test-health-sink index ce7337a..7ee5e1a 100755 --- a/test/test-health-sink +++ b/test/test-health-sink @@ -47,7 +47,7 @@ while select == None: adapter = dbus.Interface(bus.get_object("org.bluez", select), "org.bluez.Adapter") -devices = adapter.ListDevices() +devices = adapter.GetProperties()["Devices"] if len(devices) == 0: print("No devices available") -- 1.7.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html