{
EnrolleeConf conf = status->getEnrolleeConf();
if(conf.getWiFiModes().size() > 0 && conf.getWiFiModes().at(0) == WIFI_11G &&
- conf.getWiFiFreq() == WIFI_5G &&
- !strcmp(conf.getDeviceName().c_str(), "Test Device"))
+ conf.getWiFiFreq() == WIFI_BOTH && conf.getDeviceName() == "Test Device")
{
isWellConstructed = true;
}
}
});
+
ESResult ret = startEnrollee();
ret = setDeviceProperty();
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
- EXPECT_EQ(ret, ES_OK);
+ EXPECT_TRUE(isWellConstructed);
ESTerminateEnrollee();
}
}
}
});
+
ESResult ret = startEnrollee();
ret = setDeviceProperty();
ret = ESSetState(ES_STATE_CONNECTED_TO_ENROLLER);
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
- EXPECT_EQ(ret, ES_OK);
+ EXPECT_TRUE(isWellConstructed);
ESTerminateEnrollee();
}
mocks.ExpectCallFunc(onGetWifiRsrc).Do(
[& isRepFlag](const OCRepresentation& /*rep*/)
{
-
isRepFlag = true;
});
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
- EXPECT_EQ(ret, ES_OK);
+ EXPECT_TRUE(isRepFlag);
ESTerminateEnrollee();
}
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
- EXPECT_EQ(ret, ES_OK);
+ EXPECT_TRUE(isRepFlag);
ESTerminateEnrollee();
}
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
- EXPECT_EQ(ret, ES_OK);
+ EXPECT_TRUE(isRepFlag);
ESTerminateEnrollee();
}
std::unique_lock< std::mutex > lock{ mutexForCondition };
responseCon.wait_for(lock, g_waitForResponse);
- EXPECT_EQ(ret, ES_OK);
+ EXPECT_TRUE(isRepFlag);
ESTerminateEnrollee();
}
JniRemoteEnrollee *jniRemoteEnrollee = new JniRemoteEnrollee(nativeRemoteEnrollee);
ESSetHandle<JniRemoteEnrollee>(env, jRemoteEnrollee, jniRemoteEnrollee);
}
- catch (ESBadRequestException exception)
+ catch (ESBadRequestException &exception)
{
ES_LOGE("JniEasySetup::nativeCreateRemoteEnrollee Unable to create the Native EnrolleeDevice");
//throw the exception to java layer
- throwESException( env, exception.what());
+ throwESException(env, exception.what());
}
ES_LOGI("JniEasySetup::nativeCreateRemoteEnrollee exit");
env->Throw((jthrowable)ex);
}
-OCConnectivityType getOCConnectivityTypeFromInt(int connectivityType)
-{
- switch (connectivityType)
- {
- case CT_DEFAULT:
- return CT_DEFAULT;
- case CT_ADAPTER_IP:
- return CT_ADAPTER_IP;
-
- //May be need to add more types, if easy setup service support more transport.
- }
- return CT_DEFAULT;
-}
-
-WIFI_AUTHTYPE getWifiAuthTypeFromInt(int authType)
-{
- switch (authType)
- {
- case 0:
- return WIFI_AUTHTYPE::NONE_AUTH;
- case 1:
- return WIFI_AUTHTYPE::WEP;
- case 2:
- return WIFI_AUTHTYPE::WPA_PSK;
- case 3:
- return WIFI_AUTHTYPE::WPA2_PSK;
- }
- return NONE_AUTH;
-}
-
-WIFI_ENCTYPE getWifiEncTypeFromInt(int encType)
-{
- switch (encType)
- {
- case 0:
- return WIFI_ENCTYPE::NONE_ENC;
- case 1:
- return WIFI_ENCTYPE::WEP_64;
- case 2:
- return WIFI_ENCTYPE::WEP_128;
- case 3:
- return WIFI_ENCTYPE::TKIP;
- case 4:
- return WIFI_ENCTYPE::AES;
- case 5:
- return WIFI_ENCTYPE::TKIP_AES;
- }
- return NONE_ENC;
-}
-
-int convertNativeWifiFreqToInt(WIFI_FREQ wifiFreq)
-{
- switch (wifiFreq)
- {
- case WIFI_FREQ::WIFI_24G:
- return 0;
- case WIFI_FREQ::WIFI_5G:
- return 1;
- case WIFI_FREQ::WIFI_BOTH:
- return 2;
- }
-}
-
-int convertNativeWifiModeToInt(WIFI_MODE wifiMode)
-{
- switch (wifiMode)
- {
- case WIFI_MODE::WIFI_11A:
- return 0;
- case WIFI_MODE::WIFI_11B:
- return 1;
- case WIFI_MODE::WIFI_11G:
- return 2;
- case WIFI_MODE::WIFI_11N:
- return 3;
- case WIFI_MODE::WIFI_11AC:
- return 4;
- }
-}
\ No newline at end of file
{
m_sharedResource->getStatus(getEnrolleeStatusCallback);
}
- catch (ESBadRequestException exception)
+ catch (ESBadRequestException &exception)
{
ES_LOGE("JNI getStatus :: Exception occured");
//throw the exception to java
- throwESException( env, exception.what());
+ throwESException(env, exception.what());
}
}
{
m_sharedResource->getConfiguration(getConfigurationStatusCallback);
}
- catch (ESBadRequestException exception)
+ catch (ESBadRequestException &exception)
{
ES_LOGE("JNI getConfiguration :: Exception occured");
//throw the exception to java
- throwESException( env, exception.what());
+ throwESException(env, exception.what());
}
}
{
m_sharedResource->provisionSecurity(secProvStatusCallback);
}
- catch (ESBadRequestException exception)
+ catch (ESBadRequestException &exception)
{
ES_LOGE("JNI provisionSecurity :: Exception occured");
//throw the exception to java
- throwESException( env, exception.what());
+ throwESException(env, exception.what());
}
}
{
m_sharedResource->provisionDeviceProperties(deviceProp, devicePropProvStatusCallback);
}
- catch (ESBadRequestException exception)
+ catch (ESBadRequestException &exception)
{
ES_LOGE("JNI provisionDeviceProperties :: Exception occured");
//throw the exception to java
- throwESException( env, exception.what());
+ throwESException(env, exception.what());
}
}
{
m_sharedResource->provisionCloudProperties(cloudProp, cloudPropProvStatusCallback);
}
- catch (ESBadRequestException exception)
+ catch (ESBadRequestException &exception)
{
ES_LOGE("JNI startProvisioning :: Exception occured");
//throw the exception to java
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "isOwnedDeviceRegisteredInDB IN");
- OCStackResult res = OC_STACK_ERROR;
-
OCUuidList_t *uuidList = NULL;
size_t numOfDevices = 0;
- res = PDMGetOwnedDevices(&uuidList, &numOfDevices);
+ OCStackResult res = PDMGetOwnedDevices(&uuidList, &numOfDevices);
if (OC_STACK_OK != res)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Error while getting info from DB");