2 * ***************************************************************
\r
4 * Copyright 2015 Samsung Electronics All Rights Reserved.
\r
8 * Licensed under the Apache License, Version 2.0 (the "License");
\r
9 * you may not use this file except in compliance with the License.
\r
10 * You may obtain a copy of the License at
\r
12 * http://www.apache.org/licenses/LICENSE-2.0
\r
14 * Unless required by applicable law or agreed to in writing, software
\r
15 * distributed under the License is distributed on an "AS IS" BASIS,
\r
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 * See the License for the specific language governing permissions and
\r
18 * limitations under the License.
\r
20 * ****************************************************************
\r
22 package org.iotivity.service.easysetup.mediator;
\r
24 import android.content.Context;
\r
25 import android.net.wifi.WifiConfiguration;
\r
28 import org.iotivity.service.easysetup.mediator.ip.WiFiSoftAPManager;
\r
30 public class OnBoardEnrollee {
\r
31 WiFiSoftAPManager wifiSoftAPManager;
\r
32 IOnBoardingStatus deviceScanListener;
\r
35 * Constructor for OnBoardEnrollee. Constructs a new OnBoardEnrollee.
\r
37 public OnBoardEnrollee(Context context) {
\r
38 wifiSoftAPManager = new WiFiSoftAPManager(context);
\r
41 public void registerOnBoardingStatusHandler(
\r
42 IOnBoardingStatus deviceScanListener) {
\r
43 this.deviceScanListener = deviceScanListener;
\r
46 public void startDeviceScan() {
\r
47 wifiSoftAPManager.getClientList(this.deviceScanListener, 300);
\r
50 public void enableWiFiAP(WifiConfiguration netConfig, boolean enabled) {
\r
51 wifiSoftAPManager.setWifiApEnabled(netConfig, true);
\r
54 public void disableWiFiAP() {
\r
55 wifiSoftAPManager.setWifiApEnabled(null, false);
\r