1 // Copyright 2015 The Weave Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef LIBWEAVE_INCLUDE_WEAVE_PROVIDER_WIFI_H_ 6 #define LIBWEAVE_INCLUDE_WEAVE_PROVIDER_WIFI_H_ 7 8 #include <string> 9 10 #include <base/callback.h> 11 #include <weave/error.h> 12 13 namespace weave { 14 namespace provider { 15 16 // Interface with methods to control WiFi capability of the device. 17 class Wifi { 18 public: 19 // Connects to the given network with the given pass-phrase. Implementation 20 // should post either of callbacks. 21 virtual void Connect(const std::string& ssid, 22 const std::string& passphrase, 23 const DoneCallback& callback) = 0; 24 25 // Starts WiFi access point for wifi setup. 26 virtual void StartAccessPoint(const std::string& ssid) = 0; 27 28 // Stops WiFi access point. 29 virtual void StopAccessPoint() = 0; 30 31 virtual bool IsWifi24Supported() const = 0; 32 virtual bool IsWifi50Supported() const = 0; 33 34 protected: ~Wifi()35 virtual ~Wifi() {} 36 }; 37 38 } // namespace provider 39 } // namespace weave 40 41 #endif // LIBWEAVE_INCLUDE_WEAVE_PROVIDER_WIFI_H_ 42