DBus/P2P: Rectified type of SecondaryDeviceTypes in device property Get

To be consistent with what it expected in corresponding Set property as
byte[][].

Signed-off-by: Jayant Sane <jayant.sane@intel.com>
This commit is contained in:
Jayant Sane 2011-07-04 20:27:53 +03:00 committed by Jouni Malinen
parent b05fe0e557
commit a362dc1d43

View file

@ -660,8 +660,9 @@ DBusMessage *wpas_dbus_getter_p2p_device_properties(DBusMessage * message,
{ {
DBusMessage *reply = NULL; DBusMessage *reply = NULL;
DBusMessageIter iter, variant_iter, dict_iter; DBusMessageIter iter, variant_iter, dict_iter;
DBusMessageIter iter_secdev_dict_entry, iter_secdev_dict_val,
iter_secdev_dict_array;
const char *dev_name; const char *dev_name;
int num_sec_dev_types = 0;
int num_vendor_extensions = 0; int num_vendor_extensions = 0;
int i; int i;
const struct wpabuf *vendor_ext[P2P_MAX_WPS_VENDOR_EXT]; const struct wpabuf *vendor_ext[P2P_MAX_WPS_VENDOR_EXT];
@ -694,17 +695,28 @@ DBusMessage *wpas_dbus_getter_p2p_device_properties(DBusMessage * message,
goto err_no_mem; goto err_no_mem;
/* Secondary device types */ /* Secondary device types */
for (i = 0; i < MAX_SEC_DEVICE_TYPES; i++) { if (wpa_s->conf->num_sec_device_types) {
if (wpa_s->conf->sec_device_type[i] == NULL) if (!wpa_dbus_dict_begin_array(&dict_iter,
break; "SecondaryDeviceTypes",
num_sec_dev_types++; DBUS_TYPE_ARRAY_AS_STRING
} DBUS_TYPE_BYTE_AS_STRING,
&iter_secdev_dict_entry,
&iter_secdev_dict_val,
&iter_secdev_dict_array))
goto err_no_mem;
if (!wpa_dbus_dict_append_string_array( for (i = 0; i < wpa_s->conf->num_sec_device_types; i++)
&dict_iter, "SecondaryDeviceTypes", wpa_dbus_dict_bin_array_add_element(
(const char **)wpa_s->conf->sec_device_type, &iter_secdev_dict_array,
num_sec_dev_types)) wpa_s->conf->sec_device_type[i],
goto err_no_mem; WPS_DEV_TYPE_LEN);
if (!wpa_dbus_dict_end_array(&dict_iter,
&iter_secdev_dict_entry,
&iter_secdev_dict_val,
&iter_secdev_dict_array))
goto err_no_mem;
}
/* Vendor Extensions */ /* Vendor Extensions */
for (i = 0; i < P2P_MAX_WPS_VENDOR_EXT; i++) { for (i = 0; i < P2P_MAX_WPS_VENDOR_EXT; i++) {