[AWARE] Fix type of channel width to use enumeration
The Aware channel width was using an int - whereas an Enum already
exists and is the approriate type.
Bug: 37007030
Test: builds, verified by manual inspection of logs
Change-Id: If93a4cddf0e3304658d7b638de1588de1cd04d34
diff --git a/wifi/1.2/default/hidl_struct_util.cpp b/wifi/1.2/default/hidl_struct_util.cpp
index 2e3e0ab..33450ab 100644
--- a/wifi/1.2/default/hidl_struct_util.cpp
+++ b/wifi/1.2/default/hidl_struct_util.cpp
@@ -26,6 +26,9 @@
namespace implementation {
namespace hidl_struct_util {
+WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(
+ legacy_hal::wifi_channel_width type);
+
hidl_string safeConvertChar(const char* str, size_t max_len) {
const char* c = str;
size_t size = 0;
@@ -2044,7 +2047,8 @@
*hidl_struct = {};
hidl_struct->channelFreq = legacy_struct.channel;
- hidl_struct->channelBandwidth = legacy_struct.bandwidth;
+ hidl_struct->channelBandwidth = convertLegacyWifiChannelWidthToHidl(
+ (legacy_hal::wifi_channel_width)legacy_struct.bandwidth);
hidl_struct->numSpatialStreams = legacy_struct.nss;
return true;
diff --git a/wifi/1.2/types.hal b/wifi/1.2/types.hal
index 1636ae8..b962963 100644
--- a/wifi/1.2/types.hal
+++ b/wifi/1.2/types.hal
@@ -19,6 +19,7 @@
import @1.0::MacAddress;
import @1.0::NanDataPathConfirmInd;
import @1.0::WifiChannelInMhz;
+import @1.0::WifiChannelWidthInMhz;
/**
* NAN configuration request parameters added in the 1.2 HAL. These are supplemental to previous
@@ -67,7 +68,7 @@
/**
* Channel bandwidth in MHz.
*/
- uint32_t channelBandwidth;
+ WifiChannelWidthInMhz channelBandwidth;
/**
* Number of spatial streams used in the channel.
*/