aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-05-17 18:28:54 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-17 18:28:54 +0000
commit0bb3e2dcc6bc79a2eef67e87004bcbdaa67ab96f (patch)
treedf52153e0a44508fba09dc600a76c691937b20e4
parent502ff36f1f5d010bb6347cdee07ef9cd98067c99 (diff)
parent61ff0841315ac08f3621d67b62b4a40c70acfb48 (diff)
downloadwpa_supplicant_8-0bb3e2dcc6bc79a2eef67e87004bcbdaa67ab96f.tar.gz
wpa_supplicant(hidl): Prepend length for WFD IE
am: 61ff084131 Change-Id: I4b65bafb18a2e1c7e57eff9e67992da18d6d2195
-rw-r--r--wpa_supplicant/hidl/p2p_iface.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/wpa_supplicant/hidl/p2p_iface.cpp b/wpa_supplicant/hidl/p2p_iface.cpp
index 1dddb340..252266ba 100644
--- a/wpa_supplicant/hidl/p2p_iface.cpp
+++ b/wpa_supplicant/hidl/p2p_iface.cpp
@@ -24,6 +24,7 @@ const char kConfigMethodStrDisplay[] = "display";
const char kConfigMethodStrKeypad[] = "keypad";
constexpr char kSetMiracastMode[] = "MIRACAST ";
constexpr uint8_t kWfdDeviceInfoSubelemId = 0;
+constexpr char kWfdDeviceInfoSubelemLenHexStr[] = "0006";
using android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface;
uint8_t convertHidlMiracastModeToInternal(
@@ -1138,14 +1139,16 @@ SupplicantStatus P2pIface::setWfdDeviceInfoInternal(
const std::array<uint8_t, 6>& info)
{
struct wpa_supplicant* wpa_s = retrieveIfacePtr();
- uint32_t wfd_device_info_hex_len = info.size() * 2 + 1;
- std::vector<char> wfd_device_info_hex(wfd_device_info_hex_len);
+ std::vector<char> wfd_device_info_hex(info.size() * 2 + 1);
wpa_snprintf_hex(
wfd_device_info_hex.data(), wfd_device_info_hex.size(), info.data(),
info.size());
+ // |wifi_display_subelem_set| expects the first 2 bytes
+ // to hold the lenght of the subelement. In this case it's
+ // fixed to 6, so prepend that.
std::string wfd_device_info_set_cmd_str =
std::to_string(kWfdDeviceInfoSubelemId) + " " +
- wfd_device_info_hex.data();
+ kWfdDeviceInfoSubelemLenHexStr + wfd_device_info_hex.data();
std::vector<char> wfd_device_info_set_cmd(
wfd_device_info_set_cmd_str.c_str(),
wfd_device_info_set_cmd_str.c_str() +