import android.content.Context;\r
import android.util.Log;\r
\r
-import org.iotivity.base.OcConnectivityType;\r
-import org.iotivity.service.easysetup.mediator.common.ProvisioningInfo;\r
-import org.iotivity.service.easysetup.mediator.ip.IPProvisioningInfo;\r
-\r
public class ProvisionEnrollee {\r
private static final String TAG = "ProvisionEnrollee";\r
+ private Context appContext = null;\r
private EasySetupManager easySetupManagerNativeInstance = null;\r
private IProvisioningListener provisioningListener;\r
\r
- static {\r
- // Load Easy Setup JNI interface\r
- System.loadLibrary("gnustl_shared");\r
- System.loadLibrary("octbstack");\r
- System.loadLibrary("connectivity_abstraction");\r
- System.loadLibrary("easysetup-jni");\r
- }\r
/**\r
* Constructor for ProvisionEnrollee. Constructs a new ProvisionEnrollee.\r
*/\r
public ProvisionEnrollee(Context context) {\r
+ appContext = context;\r
easySetupManagerNativeInstance = EasySetupManager.getInstance();\r
+ easySetupManagerNativeInstance.initEasySetup();\r
}\r
- \r
+\r
@Override\r
protected void finalize() throws Throwable {\r
super.finalize();\r
easySetupManagerNativeInstance.terminateEasySetup();\r
}\r
\r
- public void provisionEnrollee(ProvisioningInfo provisioningInfo,\r
- OcConnectivityType connectivityType) {\r
- if(connectivityType == OcConnectivityType.CT_IP_USE_V4)\r
- {\r
- easySetupManagerNativeInstance.initEasySetup();\r
- easySetupManagerNativeInstance.provisionIPEnrollee(\r
- ((IPProvisioningInfo)provisioningInfo).getIpAddress(),\r
- ((IPProvisioningInfo)provisioningInfo).getNetSSID(),\r
- ((IPProvisioningInfo)provisioningInfo).getNetPWD(),\r
- OcConnectivityType.CT_IP_USE_V4.getValue());\r
- }\r
+ public void provisionEnrollee(String ipAddress, String netSSID,\r
+ String netPWD, int connectivityType) {\r
+ easySetupManagerNativeInstance.provisionEnrollee(ipAddress, netSSID,\r
+ netPWD, connectivityType);\r
}\r
\r
- public void stopEnrolleeProvisioning(OcConnectivityType connectivityType) {\r
+ public void stopEnrolleeProvisioning(int connectivityType) {\r
easySetupManagerNativeInstance\r
- .stopEnrolleeProvisioning(OcConnectivityType.CT_IP_USE_V4.getValue());\r
+ .stopEnrolleeProvisioning(connectivityType);\r
}\r
\r
public void ProvisioningStatusCallBack(int statuscode) {\r