Merge branch 'upstream' into tizen
[platform/upstream/iotivity.git] / service / easy-setup / mediator / richsdk / android / EasySetupCore / src / main / java / org / iotivity / service / easysetup / mediator / IpOnBoardingConnection.java
1 /**
2  * ***************************************************************
3  * <p/>
4  * Copyright 2015 Samsung Electronics All Rights Reserved.
5  * <p/>
6  * <p/>
7  * <p/>
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * <p/>
12  * http://www.apache.org/licenses/LICENSE-2.0
13  * <p/>
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * <p/>
20  * ****************************************************************
21  */
22
23 package org.iotivity.service.easysetup.mediator;
24
25 public class IpOnBoardingConnection implements OnBoardingConnection {
26
27     private boolean mIsConnected;
28     private String mIp;
29     private String mHardwareAddress;
30     private String mDeviceName;
31
32     /**
33      * @mThrottlingDelay
34      * After creating the Soft AP at Mediator & on-boarding the-
35      * -Enrollee device on it provisioning needs to be delayed by at least 2000 ms for Android Mediator
36      */
37     private int mThrottlingDelay = 2000 ;
38
39     int getThrottlingDelay() {
40         return mThrottlingDelay;
41     }
42
43     IpOnBoardingConnection(boolean enrolleeOnboarded) {
44         mThrottlingDelay = 0;
45         mIp = "0.0.0.01";
46         mIsConnected = enrolleeOnboarded; // Always true for this constructor
47     }
48
49     IpOnBoardingConnection(){}
50
51     public void setHardwareAddress(String address) {
52         mHardwareAddress = address;
53     }
54
55     public String getHardwareAddress() {
56         return mHardwareAddress;
57     }
58
59     public void setDeviceName(String name) {
60         mDeviceName = name;
61     }
62
63     public String getDeviceName() {
64         return mDeviceName;
65     }
66
67     public void setConnectivity(boolean connected) {
68         mIsConnected = connected;
69     }
70
71     public void setIp(String ip) {
72         mIp = ip;
73     }
74
75     public String getIp() {
76         return mIp;
77     }
78
79     @Override
80     public String getDesc() {
81         return "Description";
82     }
83
84     @Override
85     public boolean isConnected() {
86         return mIsConnected;
87     }
88
89     @Override
90     public Object getConnection() {
91         return this;
92     }
93
94 }