#include <binder/IPCThreadState.h>
#include <binder/PermissionCache.h>
+#include "wificond/logging_utils.h"
#include "wificond/net/netlink_utils.h"
#include "wificond/scanning/scan_utils.h"
stringstream ss;
ss << "Current wiphy index: " << wiphy_index_ << endl;
+ ss << "Cached interfaces list from kernel message: " << endl;
+ for (const auto& iface : interfaces_) {
+ ss << "Interface index: " << iface.index
+ << ", name: " << iface.name
+ << ", mac address: "
+ << LoggingUtils::GetMacString(iface.mac_address) << endl;
+ }
if (!WriteStringToFd(ss.str(), fd)) {
PLOG(ERROR) << "Failed to dump state to fd " << fd;
this,
_1));
- vector<InterfaceInfo> interfaces;
- if (!netlink_utils_->GetInterfaces(wiphy_index_, &interfaces)) {
+ interfaces_.clear();
+ if (!netlink_utils_->GetInterfaces(wiphy_index_, &interfaces_)) {
LOG(ERROR) << "Failed to get interfaces info from kernel";
return false;
}
- for (InterfaceInfo& iface : interfaces) {
+ for (const auto& iface : interfaces_) {
// Some kernel/driver uses station type for p2p interface.
// In that case we can only rely on hard-coded name to exclude
// p2p interface from station interfaces.
std::unique_ptr<RttControllerImpl> rtt_controller_;
+ // Cached interface list from kernel.
+ std::vector<InterfaceInfo> interfaces_;
+
DISALLOW_COPY_AND_ASSIGN(Server);
};