summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNingyuan Wang2016-10-05 16:25:22 -0500
committerNingyuan Wang2016-10-25 15:34:19 -0500
commit042736e71ac9b9e18c38c00a3d588a5239a1da0f (patch)
treea925396298061d9f7584f0a4c843f846f4d2b9cd /client_interface_impl.h
parenteb59d4dd54bfaaaac243e762462bbe25f4797ea4 (diff)
downloadsystem-connectivity-wificond-042736e71ac9b9e18c38c00a3d588a5239a1da0f.tar.gz
system-connectivity-wificond-042736e71ac9b9e18c38c00a3d588a5239a1da0f.tar.xz
system-connectivity-wificond-042736e71ac9b9e18c38c00a3d588a5239a1da0f.zip
Monitor mlme event for wificond
1. This allows NetlinkManager to monitor MLME events. 2. This adds internal API for tracking MLME events. 3. This creates classes representing different MLME events. 4. ClientInterfaceImpl will update frequency and bssid upon ASSOCIATE/CONNECT/ROAM events. Bug: 31961586 Test: compile, manual tests Change-Id: I1bd62dfa85596fd262709038fb73fc6e0ff9c5f3
Diffstat (limited to 'client_interface_impl.h')
-rw-r--r--client_interface_impl.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/client_interface_impl.h b/client_interface_impl.h
index 195e61b..72f581f 100644
--- a/client_interface_impl.h
+++ b/client_interface_impl.h
@@ -25,14 +25,28 @@
25#include <wifi_system/supplicant_manager.h> 25#include <wifi_system/supplicant_manager.h>
26 26
27#include "android/net/wifi/IClientInterface.h" 27#include "android/net/wifi/IClientInterface.h"
28#include "wificond/net/mlme_event_handler.h"
28 29
29namespace android { 30namespace android {
30namespace wificond { 31namespace wificond {
31 32
32class ClientInterfaceBinder; 33class ClientInterfaceBinder;
34class ClientInterfaceImpl;
33class NetlinkUtils; 35class NetlinkUtils;
34class ScanUtils; 36class ScanUtils;
35 37
38class MlmeEventHandlerImpl : public MlmeEventHandler {
39 public:
40 MlmeEventHandlerImpl(ClientInterfaceImpl* client_interface);
41 ~MlmeEventHandlerImpl() override;
42 void OnConnect(std::unique_ptr<MlmeConnectEvent> event) override;
43 void OnRoam(std::unique_ptr<MlmeRoamEvent> event) override;
44 void OnAssociate(std::unique_ptr<MlmeAssociateEvent> event) override;
45
46 private:
47 ClientInterfaceImpl* client_interface_;
48};
49
36// Holds the guts of how we control network interfaces capable of connecting to 50// Holds the guts of how we control network interfaces capable of connecting to
37// access points via wpa_supplicant. 51// access points via wpa_supplicant.
38// 52//
@@ -70,6 +84,7 @@ class ClientInterfaceImpl {
70 std::vector<std::vector<uint8_t>>& ssids, 84 std::vector<std::vector<uint8_t>>& ssids,
71 std::vector<uint32_t>& frequencies); 85 std::vector<uint32_t>& frequencies);
72 void OnSchedScanResultsReady(uint32_t interface_index); 86 void OnSchedScanResultsReady(uint32_t interface_index);
87 bool RefreshAssociateFreq();
73 88
74 const std::string interface_name_; 89 const std::string interface_name_;
75 const uint32_t interface_index_; 90 const uint32_t interface_index_;
@@ -78,9 +93,14 @@ class ClientInterfaceImpl {
78 android::wifi_system::SupplicantManager* const supplicant_manager_; 93 android::wifi_system::SupplicantManager* const supplicant_manager_;
79 NetlinkUtils* const netlink_utils_; 94 NetlinkUtils* const netlink_utils_;
80 ScanUtils* const scan_utils_; 95 ScanUtils* const scan_utils_;
96 const std::unique_ptr<MlmeEventHandlerImpl> mlme_event_handler_;
81 const android::sp<ClientInterfaceBinder> binder_; 97 const android::sp<ClientInterfaceBinder> binder_;
82 98
99 std::vector<uint8_t> bssid_;
100 uint32_t associate_freq_;
101
83 DISALLOW_COPY_AND_ASSIGN(ClientInterfaceImpl); 102 DISALLOW_COPY_AND_ASSIGN(ClientInterfaceImpl);
103 friend class MlmeEventHandlerImpl;
84}; 104};
85 105
86} // namespace wificond 106} // namespace wificond