]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AOSP: Add WFD dev info in device found event
authorJouni Malinen <j@w1.fi>
Fri, 1 Nov 2013 10:55:55 +0000 (12:55 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 1 Nov 2013 14:36:32 +0000 (16:36 +0200)
This is a rebased version of this AOSP commit:

commit 8367dc909f536f600c7474582fe0a96bef7c78fc
Author: Irfan Sheriff <isheriff@google.com>
Date:   Sun Sep 9 17:08:19 2012 -0700

    Add WFD dev info in device found event

    Change-Id: If25804d41e7ea1d028a30c180290d8de547f43e8

wpa_supplicant/p2p_supplicant.c

index e86fab56c2434bb2db1423fce06a9691c9430010..437427e92638441e2a017f7c610dc3d9d934aacf 100644 (file)
@@ -1386,16 +1386,26 @@ void wpas_dev_found(void *ctx, const u8 *addr,
 #ifndef CONFIG_NO_STDOUT_DEBUG
        struct wpa_supplicant *wpa_s = ctx;
        char devtype[WPS_DEV_TYPE_BUFSIZE];
-
+#define WFD_DEV_INFO_SIZE 9
+       char wfd_dev_info_hex[2 * WFD_DEV_INFO_SIZE + 1];
+       os_memset(wfd_dev_info_hex, 0, sizeof(wfd_dev_info_hex));
+#ifdef CONFIG_WIFI_DISPLAY
+       if (info->wfd_subelems) {
+               wpa_snprintf_hex(wfd_dev_info_hex, sizeof(wfd_dev_info_hex),
+                                       wpabuf_head(info->wfd_subelems),
+                                       WFD_DEV_INFO_SIZE);
+       }
+#endif /* CONFIG_WIFI_DISPLAY */
        wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_FOUND MACSTR
                       " p2p_dev_addr=" MACSTR
                       " pri_dev_type=%s name='%s' config_methods=0x%x "
-                      "dev_capab=0x%x group_capab=0x%x",
+                      "dev_capab=0x%x group_capab=0x%x%s%s",
                       MAC2STR(addr), MAC2STR(info->p2p_device_addr),
                       wps_dev_type_bin2str(info->pri_dev_type, devtype,
                                            sizeof(devtype)),
-               info->device_name, info->config_methods,
-               info->dev_capab, info->group_capab);
+                      info->device_name, info->config_methods,
+                      info->dev_capab, info->group_capab,
+                      wfd_dev_info_hex[0] ? " wfd_dev_info=0x" : "", wfd_dev_info_hex);
 #endif /* CONFIG_NO_STDOUT_DEBUG */
 
        wpas_notify_p2p_device_found(ctx, info->p2p_device_addr, new_device);