[ENROLLEE] Tizen enrollee sample application build using scons command
[platform/upstream/iotivity.git] / service / easy-setup / sdk / mediator / android / EasySetupCore / src / main / java / org / iotivity / service / easysetup / mediator / IpOnBoardingConnection.java
1 /**\r
2  * ***************************************************************\r
3  * <p/>\r
4  * Copyright 2015 Samsung Electronics All Rights Reserved.\r
5  * <p/>\r
6  * <p/>\r
7  * <p/>\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
11  * <p/>\r
12  * http://www.apache.org/licenses/LICENSE-2.0\r
13  * <p/>\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
19  * <p/>\r
20  * ****************************************************************\r
21  */\r
22 \r
23 package org.iotivity.service.easysetup.mediator;\r
24 \r
25 public class IpOnBoardingConnection implements OnBoardingConnection {\r
26 \r
27     private boolean mIsConnected;\r
28     private String mIp;\r
29     private String mHardwareAddress;\r
30     private String mDeviceName;\r
31 \r
32     /**\r
33      * @mThrottlingDelay\r
34      * After creating the Soft AP at Mediator & on-boarding the-\r
35      * -Enrollee device on it provisioning needs to be delayed by at least 2000 ms for Android Mediator\r
36      */\r
37     private int mThrottlingDelay = 2000 ;\r
38 \r
39     int getThrottlingDelay() {\r
40         return mThrottlingDelay;\r
41     }\r
42 \r
43     IpOnBoardingConnection(boolean enrolleeOnboarded) {\r
44         mThrottlingDelay = 0;\r
45         mIp = "0.0.0.01";\r
46         mIsConnected = enrolleeOnboarded; // Always true for this constructor\r
47     }\r
48 \r
49     IpOnBoardingConnection(){}\r
50 \r
51     public void setHardwareAddress(String address) {\r
52         mHardwareAddress = address;\r
53     }\r
54 \r
55     public String getHardwareAddress() {\r
56         return mHardwareAddress;\r
57     }\r
58 \r
59     public void setDeviceName(String name) {\r
60         mDeviceName = name;\r
61     }\r
62 \r
63     public String getDeviceName() {\r
64         return mDeviceName;\r
65     }\r
66 \r
67     public void setConnectivity(boolean connected) {\r
68         mIsConnected = connected;\r
69     }\r
70 \r
71     public void setIp(String ip) {\r
72         mIp = ip;\r
73     }\r
74 \r
75     public String getIp() {\r
76         return mIp;\r
77     }\r
78 \r
79     @Override\r
80     public String getDesc() {\r
81         return "Description";\r
82     }\r
83 \r
84     @Override\r
85     public boolean isConnected() {\r
86         return mIsConnected;\r
87     }\r
88 \r
89     @Override\r
90     public Object getConnection() {\r
91         return this;\r
92     }\r
93 \r
94 }\r