Refactoring of EasySetup Android implementation
[platform/upstream/iotivity.git] / service / easy-setup / sdk / mediator / android / EasySetupCore / src / main / java / org / iotivity / service / easysetup / impl / WiFiOnBoardingConfig.java
1 package org.iotivity.service.easysetup.impl;
2
3 import org.iotivity.service.easysetup.core.ConnectionInterface;
4 import org.iotivity.service.easysetup.core.IpConnection;
5 import org.iotivity.service.easysetup.core.OnBoardingConfig;
6
7 import android.net.wifi.WifiConfiguration;
8
9 public class WiFiOnBoardingConfig implements OnBoardingConfig{
10
11     private final WifiConfiguration config = new WifiConfiguration();
12     private final ConnType mConnType = OnBoardingConfig.ConnType.WiFi;
13     private IpConnection mConnection;
14
15     @Override
16     public Object getConfig() {
17         // TODO Auto-generated method stub
18         return config;
19     }
20
21     public void setSSId(String ssid) {
22         config.SSID = ssid;
23     }
24
25     public void setSharedKey(String sharedKey) {
26         config.preSharedKey = sharedKey;
27     }
28
29     public void setAuthAlgo(int aurthAlgo) {
30         config.allowedAuthAlgorithms.set(aurthAlgo);
31     }
32
33     public void setKms(int kms) {
34         config.allowedKeyManagement.set(kms);
35     }
36
37     @Override
38     public ConnType getConnType() {
39         // TODO Auto-generated method stub
40         return mConnType;
41     }
42
43     @Override
44     public ConnectionInterface getConnection() {
45         // TODO Auto-generated method stub
46         return mConnection;
47     }
48
49     @Override
50     public void setConnection(ConnectionInterface conn) {
51         mConnection = (IpConnection)conn;
52     }
53
54
55 }