Used OCConnectivityType b/w Java & C++ layer
authorHemant Mahsky <h.mahsky@samsung.com>
Thu, 24 Sep 2015 10:27:30 +0000 (15:57 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Thu, 24 Sep 2015 12:00:20 +0000 (12:00 +0000)
Change-Id: I34f6a55172b72414a251712d12e95bc1df1abc70
Signed-off-by: Hemant Mahsky <h.mahsky@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3037
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/easy-setup/sdk/mediator/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/core/OnBoardingConfig.java
service/easy-setup/sdk/mediator/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/impl/EnrolleeDeviceBLEOnBoarding.java
service/easy-setup/sdk/mediator/android/jni/jni_easy_setup.cpp

index 2852f9e..6da4178 100755 (executable)
@@ -22,6 +22,8 @@
 \r
 package org.iotivity.service.easysetup.core;\r
 \r
+import org.iotivity.base.OcConnectivityType;\r
+\r
 /**\r
  * It contains configuration details about the connectivity type between the Enrollee device &\r
  * Mediator device in order to perform on-boarding.\r
@@ -34,8 +36,8 @@ public interface OnBoardingConfig {
      */\r
     public static enum ConnType {\r
         // Note : Enum Ids should matched with Native Ids\r
-        WiFi(0),\r
-        BLE(1);\r
+        WiFi(OcConnectivityType.CT_DEFAULT.getValue()),\r
+        BLE(OcConnectivityType.CT_ADAPTER_GATT_BTLE.getValue());\r
 \r
         private int mConnType;\r
 \r
index 406ee0e..edbe845 100755 (executable)
@@ -136,11 +136,11 @@ public class EnrolleeDeviceBLEOnBoarding extends EnrolleeDevice {
         easySetupManagerNativeInstance.setApplicationContext(mContext);
         easySetupManagerNativeInstance.initEasySetup();
         Log.d("init", "successful");
-        OcConnectivityType ocConnectivityType = OcConnectivityType.CT_ADAPTER_GATT_BTLE;
+
         easySetupManagerNativeInstance.provisionEnrollee(connection.getMacaddress(),
                 wifiProvConfig.getSsId(),
                 wifiProvConfig.getPassword(),
-                ocConnectivityType.getValue());
+                mOnBoardingConfig.getConnType().getValue());
 
 
     }
index 73851fa..60628dc 100644 (file)
@@ -187,14 +187,7 @@ jConnectivityType)
 {
 LOGI("JNI Stop Easy Setup: Entering");
 
-OCConnectivityType connecitivityType = OCConnectivityType::CT_DEFAULT;
-
-if(jConnectivityType == 0)
-{
-connecitivityType = OCConnectivityType::CT_ADAPTER_IP;
-}
-
-StopProvisioning(connecitivityType);
+StopProvisioning((OCConnectivityType) jConnectivityType);
 
 return;
 }