adapter: Targets is an array of object paths
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 9 May 2011 14:37:35 +0000 (16:37 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 21 Oct 2011 06:54:03 +0000 (23:54 -0700)
src/adapter.c
test/list-adapters

index 55fc645..d00d054 100644 (file)
@@ -192,7 +192,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
                                DBUS_TYPE_STRING, append_protocols, adapter);
 
        near_dbus_dict_append_array(&dict, "Targets",
-                               DBUS_TYPE_STRING, append_targets, adapter);
+                               DBUS_TYPE_OBJECT_PATH, append_targets, adapter);
 
        near_dbus_dict_close(&array, &dict);
 
index 857d024..c8e7dc6 100755 (executable)
@@ -32,30 +32,9 @@ for path in properties["Adapters"]:
                 val = "true"
             else:
                 val = "false"
-        elif key in ["Protocols"]:
+        elif key in ["Protocols", "Targets"]:
             val = extract_list(properties[key])
         else:
             val = str(properties[key])
             
         print "        %s = %s" % (key, val)
-
-
-    if "CurrentTarget" in properties.keys():
-           path = str(properties["CurrentTarget"]);
-
-           print "        Target = [ %s ]" % (path)
-
-           target = dbus.Interface(bus.get_object("org.neard", path),
-                                               "org.neard.Target")
-
-           properties = target.GetProperties()
-
-           for key in properties.keys():
-                   if key in ["Protocols"]:
-                           val = extract_list(properties[key])
-                   elif key in ["TagType"]:
-                           val = extract_list(properties[key])
-                   else:
-                           val = str(properties[key])
-
-                   print "             %s = %s" % (key, val)