14615e0d5aa416ab1a8596bde68f71f7ebe431b86Vitaly Buka// Copyright 2015 The Weave Authors. All rights reserved. 21fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka// Use of this source code is governed by a BSD-style license that can be 31fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka// found in the LICENSE file. 41fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 51e3636732171afb8cceb9e5cb835ec6a93787dbaVitaly Buka#ifndef LIBWEAVE_INCLUDE_WEAVE_PROVIDER_WIFI_H_ 61e3636732171afb8cceb9e5cb835ec6a93787dbaVitaly Buka#define LIBWEAVE_INCLUDE_WEAVE_PROVIDER_WIFI_H_ 71fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 81fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka#include <string> 91fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 101fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka#include <base/callback.h> 111fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka#include <weave/error.h> 121fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 131fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Bukanamespace weave { 141e3636732171afb8cceb9e5cb835ec6a93787dbaVitaly Bukanamespace provider { 151fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 161fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka// Interface with methods to control WiFi capability of the device. 171e3636732171afb8cceb9e5cb835ec6a93787dbaVitaly Bukaclass Wifi { 181fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka public: 191fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka // Connects to the given network with the given pass-phrase. Implementation 201fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka // should post either of callbacks. 211fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka virtual void Connect(const std::string& ssid, 221fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka const std::string& passphrase, 23747634273144e0df7b37475375ad4790b6a7b0e8Vitaly Buka const DoneCallback& callback) = 0; 241fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 251fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka // Starts WiFi access point for wifi setup. 261fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka virtual void StartAccessPoint(const std::string& ssid) = 0; 271fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 281fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka // Stops WiFi access point. 291fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka virtual void StopAccessPoint() = 0; 301fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 316a1ba84d9b295dcc0c8f50b580182a665c4aa8ceVitaly Buka virtual bool IsWifi24Supported() const = 0; 326a1ba84d9b295dcc0c8f50b580182a665c4aa8ceVitaly Buka virtual bool IsWifi50Supported() const = 0; 336a1ba84d9b295dcc0c8f50b580182a665c4aa8ceVitaly Buka 341fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka protected: 353bfb13d1a7a1d1677b3b3af9264f7cbecb6b71bdVitaly Buka virtual ~Wifi() {} 361fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka}; 371fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 381e3636732171afb8cceb9e5cb835ec6a93787dbaVitaly Buka} // namespace provider 391fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka} // namespace weave 401fd619a3ff996aac12bd0ef2ed99090e4dc6b6ddVitaly Buka 411e3636732171afb8cceb9e5cb835ec6a93787dbaVitaly Buka#endif // LIBWEAVE_INCLUDE_WEAVE_PROVIDER_WIFI_H_ 42