Commit efc8b9ab authored by Parkhi's avatar Parkhi Committed by Madan Lanka

Update Easysetup mediator android sample app

 - Add validation check logic when received response of findResource.

Change-Id: Ib2e9f6bf3534f77e7d6260fca803ccf629df5b2d
Signed-off-by: default avatarParkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14617Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 6b7ef501
...@@ -403,7 +403,7 @@ public class EasysetupActivity extends Activity ...@@ -403,7 +403,7 @@ public class EasysetupActivity extends Activity
return; return;
} }
if(ocResource.getHost().contains("coap+tcp")) { if(ocResource.getHost().contains("+tcp")) {
Log.d(TAG, "Recv Found resource event from tcp port," + Log.d(TAG, "Recv Found resource event from tcp port," +
"ignoring URI : " + ocResource.getUri()); "ignoring URI : " + ocResource.getUri());
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
...@@ -422,6 +422,23 @@ public class EasysetupActivity extends Activity ...@@ -422,6 +422,23 @@ public class EasysetupActivity extends Activity
Log.d(TAG,"URI of the resource: " + resourceUri); Log.d(TAG,"URI of the resource: " + resourceUri);
Log.d(TAG,"Host address of the resource: " + hostAddress); Log.d(TAG,"Host address of the resource: " + hostAddress);
mRemoteEnrollee = mEasySetup.createRemoteEnrollee(ocResource);
if(mRemoteEnrollee == null) {
Log.d(TAG, "Recv Found resource event," +
"ignoring URI : " + ocResource.getUri());
runOnUiThread(new Runnable() {
@Override
public void run() {
mDiscoverResource.setEnabled(true);
}
});
return;
}
isFirstTime = false;
mEnrolleeDeviceID = ocResource.getServerId();
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -434,9 +451,6 @@ public class EasysetupActivity extends Activity ...@@ -434,9 +451,6 @@ public class EasysetupActivity extends Activity
mProvisionCloudPropProcess.setEnabled(true); mProvisionCloudPropProcess.setEnabled(true);
} }
}); });
isFirstTime = false;
mRemoteEnrollee = mEasySetup.createRemoteEnrollee(ocResource);
mEnrolleeDeviceID = ocResource.getServerId();
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment