delete jniPinListener;
jniPinListener = new JniPinCheckListener(env, jListener);
CBData.loadSecretCB = InputPinCodeCallback;
- CBData.createSecureSessionCB = CreateSecureSessionRandomPinCallbak;
+ CBData.createSecureSessionCB = CreateSecureSessionRandomPinCallback;
CBData.createSelectOxmPayloadCB = CreatePinBasedSelectOxmPayload;
CBData.createOwnerTransferPayloadCB = CreatePinBasedOwnerTransferPayload;
result = OCSecure::setOwnerTransferCallbackData((OicSecOxm_t)OxmType,
try
{
+ if (timeout < 0)
+ {
+ ThrowOcException(OC_STACK_INVALID_PARAM, "Timeout value cannot be negative");
+ return nullptr;
+ }
OCStackResult result = OCSecure::discoverUnownedDevices((unsigned short)timeout, list);
if (OC_STACK_OK != result)
{
LOGE("%s", e.reason().c_str());
ThrowOcException(OC_STACK_ERROR, e.reason().c_str());
+ return nullptr;
}
}
try
{
+ if (timeout < 0)
+ {
+ ThrowOcException(OC_STACK_INVALID_PARAM, "Timeout value cannot be negative");
+ return nullptr;
+ }
OCStackResult result = OCSecure::discoverOwnedDevices((unsigned short)timeout, list);
if (OC_STACK_OK != result)
{
{
LOGE("%s", e.reason().c_str());
ThrowOcException(OC_STACK_ERROR, e.reason().c_str());
+ return nullptr;
}
}
try
{
+ if (timeout < 0)
+ {
+ ThrowOcException(OC_STACK_INVALID_PARAM, "Timeout value cannot be negative");
+ return nullptr;
+ }
OCStackResult result = OCSecure::getDevInfoFromNetwork((unsigned short)timeout,
ownedDevList, unownedDevList);
if (OC_STACK_OK != result)
{
LOGE("%s", e.reason().c_str());
ThrowOcException(OC_STACK_ERROR, e.reason().c_str());
+ return nullptr;
}
}