From 14c21de7a4c80e41592bf5951ab57d9b3184da47 Mon Sep 17 00:00:00 2001 From: Jihun Ha Date: Thu, 16 Jun 2016 21:47:05 +0900 Subject: [PATCH] Add EasySetup class and Update RemoteEnrollee class for Android Mediator 1. The previous EasySetupService class is inconsistency to the class for C++ SDK. - Rather, EasySetup class looks better. 2. createRemoteEnrollee API is get to have void parameter Note that, we will add several APIs in these classes when they are implemented. And useless files will be removed soon. Change-Id: Iacb665bb16d1c9e8be2525801dd8a0d4613234d0 Signed-off-by: Jihun Ha Reviewed-on: https://gerrit.iotivity.org/gerrit/8705 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- service/easy-setup/mediator/richsdk/SConscript | 30 +++--- .../service/easysetup/mediator/EasySetup.java | 107 +++++++++++++++++++++ .../mediator/EnrolleeDeviceWiFiOnboarding.java | 5 + .../service/easysetup/mediator/RemoteEnrollee.java | 44 ++++----- .../mediator/richsdk/android/jni/Android.mk | 6 +- .../mediator/richsdk/android/jni/JniEasySetup.cpp | 33 ++----- .../mediator/richsdk/android/jni/JniEasySetup.h | 11 +-- .../mediator/richsdk/android/jni/JniEsUtils.cpp | 5 +- .../mediator/richsdk/android/jni/JniEsUtils.h | 2 +- .../mediator/richsdk/android/jni/JniJvm.cpp | 0 .../android/jni/JniProvisioningStatusLisener.cpp | 3 +- .../android/jni/JniProvisioningStatusListener.h | 2 +- .../richsdk/android/jni/JniRemoteEnrollee.cpp | 4 +- .../richsdk/android/jni/JniRemoteEnrollee.h | 30 +++--- 14 files changed, 185 insertions(+), 97 deletions(-) create mode 100755 service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EasySetup.java mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/RemoteEnrollee.java mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.cpp mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.h mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.cpp mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.h mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniJvm.cpp mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusLisener.cpp mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusListener.h mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.cpp mode change 100644 => 100755 service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.h diff --git a/service/easy-setup/mediator/richsdk/SConscript b/service/easy-setup/mediator/richsdk/SConscript index de1eea0..6c0c101 100644 --- a/service/easy-setup/mediator/richsdk/SConscript +++ b/service/easy-setup/mediator/richsdk/SConscript @@ -65,17 +65,17 @@ if target_os not in ['windows', 'winrt']: if target_os in ['linux']: easy_setup_env.AppendUnique(LIBS = ['pthread', 'dl', 'coap']) -#if target_os in ['android']: -# easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -# if env.get('SECURED') == '1': -# easy_setup_env.AppendUnique(LIBPATH = [env.get('SRC_DIR')+'/android/android_api/base/libs/armeabi']) -# easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')]) -# easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) -# easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared']) -# if env.get('SECURED') == '1': -# easy_setup_env.AppendUnique(LIBS = ['ocpmapi','ocprovision']) -# if not env.get('RELEASE'): -# easy_setup_env.AppendUnique(LIBS = ['log']) +if target_os in ['android']: + easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) + if env.get('SECURED') == '1': + easy_setup_env.AppendUnique(LIBPATH = [env.get('SRC_DIR')+'/android/android_api/base/libs/armeabi']) + easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')]) + easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) + easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared']) + if env.get('SECURED') == '1': + easy_setup_env.AppendUnique(LIBS = ['ocpmapi','ocprovision']) + if not env.get('RELEASE'): + easy_setup_env.AppendUnique(LIBS = ['log']) if target_os in ['linux']: easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) @@ -85,8 +85,8 @@ if target_os in ['linux']: if env.get('SECURED') == '1': easy_setup_env.AppendUnique(LIBS = ['ocpmapi', 'ocprovision']) -#if target_os in ['android','linux']: -if target_os in ['linux']: +if target_os in ['android','linux']: +#if target_os in ['linux']: easy_setup_env.PrependUnique(CPPPATH = [ env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include', env.get('SRC_DIR') + '/resource/include', @@ -114,8 +114,8 @@ print"easysetup_path %s" % easysetup_path es_src = None -#if target_os in ['android','linux']: -if target_os in ['linux']: +if target_os in ['android','linux']: +#if target_os in ['linux']: if env.get('SECURED') == '1': env.AppendUnique(es_src = [os.path.join(easysetup_path, 'src/EnrolleeSecurity.cpp')]) diff --git a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EasySetup.java b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EasySetup.java new file mode 100755 index 0000000..597e681 --- /dev/null +++ b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EasySetup.java @@ -0,0 +1,107 @@ +/** + * *************************************************************** + * + * Copyright 2017 Samsung Electronics All Rights Reserved. + * + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * **************************************************************** + */ + +package org.iotivity.service.easysetup.mediator; + +import android.content.Context; +import android.util.Log; + +import java.io.IOException; +import java.util.ArrayList; + +/** + * This is facade class, a single point of contact for Application. + * It contains set of APIs to do easy setup of the enrolling device. + * ON-BOARDING - This is a step to establish connectivity between the device & Mediator device. + * PROVISION - This is a step where the netowork's detail & credentials are given to the + * enrolling device. + */ +public class EasySetup { + + private static final String TAG = EasySetup.class.getName(); + + private static EasySetup sInstance; + + //private final EasySetupStatus mCallback; + + //private ArrayList mEnrolleeDeviceList; + + //private final ProvisioningCallback mProvisioningCallback; + + private static Context mContext; + + private ArrayList mRemoteEnrolleeList; + + protected RemoteEnrollee mRemoteEnrollee; + + //function to call the native createEnrolleeDevice + private native RemoteEnrollee nativeCreateRemoteEnrollee(); + + static { + // Load Easy Setup JNI interface + System.loadLibrary("ESMediatorRich"); + System.loadLibrary("easysetup-jni"); + } + + private EasySetup() { + //mCallback = callback; + //mProvisioningCallback = new ProvisioningCallbackImpl(mCallback); + //mEnrolleeDeviceList = new ArrayList(); + mContext = null; + } + + /** + * Gives a singleton instance of Easy setup service and initialize the service + * + * @param callback Application needs to provide this callback to receive the status of easy + * setup process. + */ + + public synchronized static EasySetup getInstance(Context context) { + if (sInstance == null) { + sInstance = new EasySetup(); + mContext = context; + } + return sInstance; + } + + public synchronized RemoteEnrollee createRemoteEnrollee() + { + // native call + mRemoteEnrollee = nativeCreateRemoteEnrollee(); + + mRemoteEnrolleeList.add(mRemoteEnrollee); + + return mRemoteEnrollee; + } + + /** + * Reset the Easy setup Service + */ + + public void finish() { + //Call the stop Provisioning + //for (EnrolleeDevice enrolleeDevice : mEnrolleeDeviceList) { + // enrolleeDevice.stopProvisioningProcess(); + //} + } +} diff --git a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EnrolleeDeviceWiFiOnboarding.java b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EnrolleeDeviceWiFiOnboarding.java index 66f12d0..ffa1b4d 100644 --- a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EnrolleeDeviceWiFiOnboarding.java +++ b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EnrolleeDeviceWiFiOnboarding.java @@ -142,6 +142,7 @@ public class EnrolleeDeviceWiFiOnboarding extends EnrolleeDevice { mProvisioningCallback.onProgress(this); final EnrolleeDevice device = this; if (mProvConfig.getConnType() == ProvisioningConfig.ConnType.WiFi) { + /* try { mRemoteEnrollee.registerProvisioningHandler(new IProvisionStatusNativeHandler() { @Override @@ -154,22 +155,26 @@ public class EnrolleeDeviceWiFiOnboarding extends EnrolleeDevice { } } }); + //native call mRemoteEnrollee.startProvision(); }catch(ESException e) { Log.i(TAG,"startProvisioningProcess Register Listener to native exception"); } + */ } } protected void stopProvisioningProcess(){ if(mState == EnrolleeState.DEVICE_PROVISIONING_STATE) { //native call + /* try { mRemoteEnrollee.stopProvision(); } catch (ESException e) { Log.i(TAG,"stopProvisioningProcess exception"); } + */ }else{ Log.i(TAG,"stopProvisioningProcess : Provisioning is not in progress"); } diff --git a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/RemoteEnrollee.java b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/RemoteEnrollee.java old mode 100644 new mode 100755 index 38328bc..db0206d --- a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/RemoteEnrollee.java +++ b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/RemoteEnrollee.java @@ -1,22 +1,22 @@ /** * *************************************************************** - *

+ * * Copyright 2016 Samsung Electronics All Rights Reserved. - *

- *

- *

+ * + * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - *

+ * * http://www.apache.org/licenses/LICENSE-2.0 - *

+ * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - *

+ * * **************************************************************** */ @@ -30,9 +30,9 @@ public class RemoteEnrollee{ public static final String TAG = RemoteEnrollee.class.getName(); private long m_nativeHandle; - private native void nativeStartProvision(); - private native void nativeStopProvision(); - private native void nativeRegisterProvisioningHandler(IProvisionStatusNativeHandler listener); + //private native void nativeStartProvision(); + //private native void nativeStopProvision(); + //private native void nativeRegisterProvisioningHandler(IProvisionStatusNativeHandler listener); /* constructor will be invoked from the native layer */ private RemoteEnrollee(long nativeHandle){ @@ -40,20 +40,20 @@ public class RemoteEnrollee{ } /* Register native Listener for the Provisioning state */ - public void registerProvisioningHandler( IProvisionStatusNativeHandler provisioningListener) throws ESException{ - // this.provisioningListener = provisioningListener; - nativeRegisterProvisioningHandler(provisioningListener); - Log.i(TAG, "JNI Callback is registered for getting provisioning status"); - } + //public void registerProvisioningHandler( IProvisionStatusNativeHandler provisioningListener) throws ESException{ + // // this.provisioningListener = provisioningListener; + // nativeRegisterProvisioningHandler(provisioningListener); + // Log.i(TAG, "JNI Callback is registered for getting provisioning status"); + //} - /* native StartProvision */ - public void startProvision() throws ESException{ - nativeStartProvision(); -} + ///* native StartProvision */ + //public void startProvision() throws ESException{ + //nativeStartProvision(); + //} /* native stopProvision */ - public void stopProvision() throws ESException{ - nativeStopProvision(); -} + //public void stopProvision() throws ESException{ + //nativeStopProvision(); + //} } diff --git a/service/easy-setup/mediator/richsdk/android/jni/Android.mk b/service/easy-setup/mediator/richsdk/android/jni/Android.mk index 87518ac..74d2ac3 100644 --- a/service/easy-setup/mediator/richsdk/android/jni/Android.mk +++ b/service/easy-setup/mediator/richsdk/android/jni/Android.mk @@ -20,7 +20,7 @@ LOCAL_MODULE := easysetup-jni DEFINE_FLAG = -DWITH_POSIX -D__ANDROID__ #Add Debug flags here -DEBUG_FLAG = -DTB_LOG +DEBUG_FLAG = -DTB_LOG BUILD_FLAG = $(DEFINE_FLAG) $(DEBUG_FLAG) @@ -34,7 +34,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../src \ $(LOCAL_PATH)/../../../../inc \ $(LOCAL_PATH)/../../../../../../resource/csdk/logger/include \ - $(LOCAL_PATH)/../../../../../../resource/csdk/connectivity/common/inc \ + $(LOCAL_PATH)/../../../../../../resource/csdk/connectivity/common/inc \ $(LOCAL_PATH)/../../../../../../resource/c_common/oic_string/include \ $(LOCAL_PATH)/../../../../../../resource/include \ $(LOCAL_PATH)/../../../../../../resource/c_common \ @@ -46,7 +46,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../../../../../../resource/csdk/security/include \ $(LOCAL_PATH)/../../../../../../extlibs/cjson \ $(LOCAL_PATH)/../../../../../../extlibs/boost/boost_1_58_0 \ - $(LOCAL_PATH)/../../../../../../extlibs/timer \ + $(LOCAL_PATH)/../../../../../../extlibs/timer \ $(LOCAL_PATH)/../../../../../../android/android_api/base/jni \ LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard $(LOCAL_PATH)/*.cpp)) diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.cpp b/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.cpp old mode 100644 new mode 100755 index a237936..88521a0 --- a/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.cpp +++ b/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.cpp @@ -26,42 +26,23 @@ using namespace OIC::Service; extern "C" { #endif JNIEXPORT jobject JNICALL -Java_org_iotivity_service_easysetup_mediator_EasySetupService_nativeCreateEnrolleeDevice -(JNIEnv *env, jobject interfaceClass, jstring ip, jstring ssid, jstring password, - jint connectivityType, jboolean isSecured) +Java_org_iotivity_service_easysetup_mediator_EasySetupService_nativeCreateRemoteEnrollee +(JNIEnv *env, jobject interfaceClass) { - LOGI("JniEasySetup::nativeCreateEnrolleeDevice enter"); + LOGI("JniEasySetup::nativeCreateRemoteEnrollee enter"); std::shared_ptr nativeRemoteEnrollee; jobject jRemoteEnrollee; - ProvConfig netInfo; - WiFiOnboadingConnection onboardConn; - - const char *cIp = (env)->GetStringUTFChars(ip, NULL); - const char *cSssid = (env)->GetStringUTFChars(ssid, NULL); - const char *cPassword = (env)->GetStringUTFChars(password, NULL); - - std::string sIp(cIp); - std::string sSssid(cSssid); - std::string sPassword(cPassword); - - netInfo.connType = getOCConnectivityTypeFromInt(connectivityType); - - onboardConn.isSecured = bool(isSecured); - - OICStrcpy(onboardConn.ipAddress, IPV4_ADDR_SIZE - 1, sIp.c_str()); - OICStrcpy(netInfo.provData.WIFI.ssid, NET_WIFI_SSID_SIZE - 1, sSssid.c_str()); - OICStrcpy(netInfo.provData.WIFI.pwd, NET_WIFI_PWD_SIZE - 1, sPassword.c_str()); try { - nativeRemoteEnrollee = EasySetup::getInstance()->createEnrolleeDevice(netInfo,onboardConn); + nativeRemoteEnrollee = EasySetup::getInstance()->createRemoteEnrollee(); //create the java object jRemoteEnrollee = env->NewObject(g_cls_RemoteEnrollee, g_mid_RemoteEnrollee_ctor); if (!jRemoteEnrollee) { - LOGE("JniEasySetup::nativeCreateEnrolleeDevice Unable to create the java object"); + LOGE("JniEasySetup::nativeCreateRemoteEnrollee Unable to create the java object"); return NULL; } @@ -70,12 +51,12 @@ Java_org_iotivity_service_easysetup_mediator_EasySetupService_nativeCreateEnroll } catch (ESBadRequestException exception) { - LOGE("JniEasySetup::nativeCreateEnrolleeDevice Unable to create the Native EnrolleeDevice"); + LOGE("JniEasySetup::nativeCreateRemoteEnrollee Unable to create the Native EnrolleeDevice"); //throw the exception to java layer throwESException( env, exception.what()); } - LOGI("JniEasySetup::nativeCreateEnrolleeDevice exit"); + LOGI("JniEasySetup::nativeCreateRemoteEnrollee exit"); return jRemoteEnrollee; } diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.h b/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.h old mode 100644 new mode 100755 index 2af8935..8dd3882 --- a/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.h +++ b/service/easy-setup/mediator/richsdk/android/jni/JniEasySetup.h @@ -47,18 +47,11 @@ extern "C" { /** * API for creating and returning the RemoteEnrollee object to Java Layer * - * @param ip - ip address of Enrollee - * @param ssid - ssid of the Enroller - * @param password - password of the enroller - * @param connectivityType - Connectivity Type - * @param needSecuredEasysetup - need secured easy setup or not - * * @return jobject - RemoteEnrolleee */ JNIEXPORT jobject JNICALL -Java_org_iotivity_service_easysetup_mediator_EasySetupService_nativeCreateEnrolleeDevice -(JNIEnv *env, jobject interfaceClass, jstring ip, jstring ssid, jstring password, - jint connectivityType, jboolean needSecuredEasysetup); +Java_org_iotivity_service_easysetup_mediator_EasySetupService_nativeCreateRemoteEnrollee +(JNIEnv *env, jobject interfaceClass); #ifdef __cplusplus } diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.cpp b/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.cpp old mode 100644 new mode 100755 index 991ad31..5eff9d2 --- a/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.cpp +++ b/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.cpp @@ -44,7 +44,7 @@ OCConnectivityType getOCConnectivityTypeFromInt(int connectivityType) } return CT_DEFAULT; } - +/* int convertNativeProvisionStateToInt(EasySetupState nativeState) { switch (nativeState) @@ -59,4 +59,5 @@ int convertNativeProvisionStateToInt(EasySetupState nativeState) return 3; } return -1; -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.h b/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.h old mode 100644 new mode 100755 index f65a68c..6b90f6b --- a/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.h +++ b/service/easy-setup/mediator/richsdk/android/jni/JniEsUtils.h @@ -50,6 +50,6 @@ OCConnectivityType getOCConnectivityTypeFromInt(int connectivityType); /** * @brief Convert EasySetupState Enum Value to int */ -int convertNativeProvisionStateToInt(EasySetupState nativeState); +//int convertNativeProvisionStateToInt(EasySetupState nativeState); #endif //__JNI_ES_UTILS_H_ diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniJvm.cpp b/service/easy-setup/mediator/richsdk/android/jni/JniJvm.cpp old mode 100644 new mode 100755 diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusLisener.cpp b/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusLisener.cpp old mode 100644 new mode 100755 index 94b15d2..07cfc33 --- a/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusLisener.cpp +++ b/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusLisener.cpp @@ -42,7 +42,7 @@ JniProvisioningStatusListener::~JniProvisioningStatusListener() if (JNI_EDETACHED == ret) g_jvm->DetachCurrentThread(); } } - +/* void JniProvisioningStatusListener::provisionStatusCallback (std::shared_ptr easySetupStatus) { @@ -105,3 +105,4 @@ void JniProvisioningStatusListener::checkExAndRemoveListener(JNIEnv *env) m_ownerResource->removeProvisioningStatusListener(env, m_jwListener); } } +*/ diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusListener.h b/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusListener.h old mode 100644 new mode 100755 index 8b37cac..237aa06 --- a/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusListener.h +++ b/service/easy-setup/mediator/richsdk/android/jni/JniProvisioningStatusListener.h @@ -57,7 +57,7 @@ class JniProvisioningStatusListener /** * @brief callback function that will be passed to Native layer */ - void provisionStatusCallback (std::shared_ptr easySetupStatus); + //void provisionStatusCallback (std::shared_ptr easySetupStatus); private: jweak m_jwListener; diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.cpp b/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.cpp old mode 100644 new mode 100755 index 353d642..a1d9696 --- a/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.cpp +++ b/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.cpp @@ -51,7 +51,7 @@ JniRemoteEnrollee *JniRemoteEnrollee::getJniRemoteEnrollee(JNIEnv *env, jobject } return remoteEnrollee; } - +/* void JniRemoteEnrollee::startProvisioning(JNIEnv *env) { try @@ -156,4 +156,4 @@ Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeRegisterProvis LOGD("nativeRegisterProvisioningHandler Exit"); } - +*/ diff --git a/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.h b/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.h old mode 100644 new mode 100755 index de1f297..d8779a0 --- a/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.h +++ b/service/easy-setup/mediator/richsdk/android/jni/JniRemoteEnrollee.h @@ -60,17 +60,17 @@ class JniRemoteEnrollee // ***** JNI APIs internally call the APIs of this class ***** // - void startProvisioning(JNIEnv *env); - void stopProvisioning(JNIEnv *env); - void registerProvisioningHandler(JNIEnv *env, jobject jListener); + //void startProvisioning(JNIEnv *env); + //void stopProvisioning(JNIEnv *env); + //void registerProvisioningHandler(JNIEnv *env, jobject jListener); - JniProvisioningStatusListener *addProvisioningStatusListener(JNIEnv *env, jobject jListener); - void removeProvisioningStatusListener(JNIEnv *env, jobject jListener); + //JniProvisioningStatusListener *addProvisioningStatusListener(JNIEnv *env, jobject jListener); + //void removeProvisioningStatusListener(JNIEnv *env, jobject jListener); static JniRemoteEnrollee *getJniRemoteEnrollee(JNIEnv *env, jobject thiz); private: - JniEsListenerManager m_provisioingStatus; + //JniEsListenerManager m_provisioingStatus; std::shared_ptr m_sharedResource; }; @@ -83,25 +83,25 @@ extern "C" { /** * API for starting the provisioning process. */ -JNIEXPORT void JNICALL -Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeStartProvision -(JNIEnv *env, jobject jClass); +//JNIEXPORT void JNICALL +//Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeStartProvision +//(JNIEnv *env, jobject jClass); /** * API for stopping the provisioning process. */ -JNIEXPORT void JNICALL -Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeStopProvision -(JNIEnv *env, jobject jClass); +//JNIEXPORT void JNICALL +//Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeStopProvision +//(JNIEnv *env, jobject jClass); /** * API for setting the lisener for recieiving provisioning status. * * @param provisiongListener - Provisioning listener [callback from native layer will be passing to this listener] */ -JNIEXPORT void JNICALL -Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeRegisterProvisioningHandler -(JNIEnv *env, jobject jClass, jobject provisiongListener); +//JNIEXPORT void JNICALL +//Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeRegisterProvisioningHandler +//(JNIEnv *env, jobject jClass, jobject provisiongListener); #ifdef __cplusplus } -- 2.7.4