Loading wifi/1.0/default/wifi_chip.cpp +23 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,29 @@ Return<uint32_t> WifiChip::getMode() { Return<void> WifiChip::requestChipDebugInfo() { if (!legacy_hal_.lock()) return Void(); // TODO add implementation IWifiChipEventCallback::ChipDebugInfo result; std::pair<wifi_error, std::string> ret = legacy_hal_.lock()->getWlanDriverVersion(); if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get driver version: " << LegacyErrorToString(ret.first); return Void(); } result.driverDescription = ret.second.c_str(); ret = legacy_hal_.lock()->getWlanFirmwareVersion(); if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware version: " << LegacyErrorToString(ret.first); return Void(); } result.firmwareDescription = ret.second.c_str(); for (const auto& callback : callbacks_) { callback->onChipDebugInfoAvailable(result); } return Void(); } Loading wifi/1.0/default/wifi_legacy_hal.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ namespace wifi { namespace V1_0 { namespace implementation { const uint32_t WifiLegacyHal::kMaxVersionStringLength = 256; WifiLegacyHal::WifiLegacyHal() : global_handle_(nullptr), wlan_interface_handle_(nullptr), Loading Loading @@ -102,6 +104,22 @@ wifi_error WifiLegacyHal::stop( return WIFI_SUCCESS; } std::pair<wifi_error, std::string> WifiLegacyHal::getWlanDriverVersion() { std::array<char, kMaxVersionStringLength> buffer; buffer.fill(0); wifi_error status = global_func_table_.wifi_get_driver_version( wlan_interface_handle_, buffer.data(), buffer.size()); return std::make_pair(status, buffer.data()); } std::pair<wifi_error, std::string> WifiLegacyHal::getWlanFirmwareVersion() { std::array<char, kMaxVersionStringLength> buffer; buffer.fill(0); wifi_error status = global_func_table_.wifi_get_firmware_version( wlan_interface_handle_, buffer.data(), buffer.size()); return std::make_pair(status, buffer.data()); } wifi_error WifiLegacyHal::retrieveWlanInterfaceHandle() { const std::string& ifname_to_find = getWlanInterfaceName(); Loading wifi/1.0/default/wifi_legacy_hal.h +5 −0 Original line number Diff line number Diff line Loading @@ -39,8 +39,13 @@ class WifiLegacyHal { wifi_error start(); // Deinitialize the legacy HAL and stop the event looper thread. wifi_error stop(const std::function<void()>& on_complete_callback); // Wrappers for all the functions in the legacy HAL function table. std::pair<wifi_error, std::string> getWlanDriverVersion(); std::pair<wifi_error, std::string> getWlanFirmwareVersion(); private: static const uint32_t kMaxVersionStringLength; // Retrieve the interface handle to be used for the "wlan" interface. wifi_error retrieveWlanInterfaceHandle(); // Run the legacy HAL event loop thread. Loading Loading
wifi/1.0/default/wifi_chip.cpp +23 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,29 @@ Return<uint32_t> WifiChip::getMode() { Return<void> WifiChip::requestChipDebugInfo() { if (!legacy_hal_.lock()) return Void(); // TODO add implementation IWifiChipEventCallback::ChipDebugInfo result; std::pair<wifi_error, std::string> ret = legacy_hal_.lock()->getWlanDriverVersion(); if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get driver version: " << LegacyErrorToString(ret.first); return Void(); } result.driverDescription = ret.second.c_str(); ret = legacy_hal_.lock()->getWlanFirmwareVersion(); if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware version: " << LegacyErrorToString(ret.first); return Void(); } result.firmwareDescription = ret.second.c_str(); for (const auto& callback : callbacks_) { callback->onChipDebugInfoAvailable(result); } return Void(); } Loading
wifi/1.0/default/wifi_legacy_hal.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ namespace wifi { namespace V1_0 { namespace implementation { const uint32_t WifiLegacyHal::kMaxVersionStringLength = 256; WifiLegacyHal::WifiLegacyHal() : global_handle_(nullptr), wlan_interface_handle_(nullptr), Loading Loading @@ -102,6 +104,22 @@ wifi_error WifiLegacyHal::stop( return WIFI_SUCCESS; } std::pair<wifi_error, std::string> WifiLegacyHal::getWlanDriverVersion() { std::array<char, kMaxVersionStringLength> buffer; buffer.fill(0); wifi_error status = global_func_table_.wifi_get_driver_version( wlan_interface_handle_, buffer.data(), buffer.size()); return std::make_pair(status, buffer.data()); } std::pair<wifi_error, std::string> WifiLegacyHal::getWlanFirmwareVersion() { std::array<char, kMaxVersionStringLength> buffer; buffer.fill(0); wifi_error status = global_func_table_.wifi_get_firmware_version( wlan_interface_handle_, buffer.data(), buffer.size()); return std::make_pair(status, buffer.data()); } wifi_error WifiLegacyHal::retrieveWlanInterfaceHandle() { const std::string& ifname_to_find = getWlanInterfaceName(); Loading
wifi/1.0/default/wifi_legacy_hal.h +5 −0 Original line number Diff line number Diff line Loading @@ -39,8 +39,13 @@ class WifiLegacyHal { wifi_error start(); // Deinitialize the legacy HAL and stop the event looper thread. wifi_error stop(const std::function<void()>& on_complete_callback); // Wrappers for all the functions in the legacy HAL function table. std::pair<wifi_error, std::string> getWlanDriverVersion(); std::pair<wifi_error, std::string> getWlanFirmwareVersion(); private: static const uint32_t kMaxVersionStringLength; // Retrieve the interface handle to be used for the "wlan" interface. wifi_error retrieveWlanInterfaceHandle(); // Run the legacy HAL event loop thread. Loading