From dc4f1d2149a8795b947de5241766587628971fb1 Mon Sep 17 00:00:00 2001 From: Rahul Rahul Date: Wed, 15 Jul 2015 11:53:37 -0700 Subject: [PATCH] Updated android examples to use OcConnectivityType.CT_DEFAULT since IPV4 is no longer supported Change-Id: Ie158c53924d934cd83450297e125c61d71b6bc79 Signed-off-by: Rahul Rahul Reviewed-on: https://gerrit.iotivity.org/gerrit/1677 Reviewed-by: Erich Keane Tested-by: jenkins-iotivity --- .../base/examples/fridgeclient/FridgeClient.java | 10 +++++----- .../src/main/java/org/iotivity/guiclient/OcWorker.java | 2 +- .../base/examples/simpleclient/SimpleClient.java | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/android/examples/fridgeclient/src/main/java/org/iotivity/base/examples/fridgeclient/FridgeClient.java b/android/examples/fridgeclient/src/main/java/org/iotivity/base/examples/fridgeclient/FridgeClient.java index 1043d3cccc..3c5038b3f1 100644 --- a/android/examples/fridgeclient/src/main/java/org/iotivity/base/examples/fridgeclient/FridgeClient.java +++ b/android/examples/fridgeclient/src/main/java/org/iotivity/base/examples/fridgeclient/FridgeClient.java @@ -88,7 +88,7 @@ public class FridgeClient extends Activity implements OcPlatform.Configure(cfg); try { OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + "intel.fridge", - OcConnectivityType.IPV4, this); + OcConnectivityType.CT_DEFAULT, this); } catch (OcException e) { logMessage(TAG + " init Error. " + e.getMessage()); Log.e(TAG, e.getMessage()); @@ -195,18 +195,18 @@ public class FridgeClient extends Activity implements lightTypes.add("intel.fridge.light"); try { OcResource light = OcPlatform.constructResourceObject(ocResource.getHost(), - StringConstants.LIGHT, OcConnectivityType.IPV4, false, lightTypes, ifaces); + StringConstants.LIGHT, OcConnectivityType.CT_DEFAULT, false, lightTypes, ifaces); List doorTypes = new LinkedList<>(); doorTypes.add("intel.fridge.door"); OcResource leftDoor = OcPlatform.constructResourceObject(ocResource.getHost(), - StringConstants.LEFT_DOOR, OcConnectivityType.IPV4, false, doorTypes, ifaces); + StringConstants.LEFT_DOOR, OcConnectivityType.CT_DEFAULT, false, doorTypes, ifaces); OcResource rightDoor = OcPlatform.constructResourceObject(ocResource.getHost(), - StringConstants.RIGHT_DOOR, OcConnectivityType.IPV4, false, doorTypes, ifaces); + StringConstants.RIGHT_DOOR, OcConnectivityType.CT_DEFAULT, false, doorTypes, ifaces); OcResource randomDoor = OcPlatform.constructResourceObject(ocResource.getHost(), - StringConstants.RANDOM_DOOR, OcConnectivityType.IPV4, false, doorTypes, ifaces); + StringConstants.RANDOM_DOOR, OcConnectivityType.CT_DEFAULT, false, doorTypes, ifaces); List headerOptions = new LinkedList<>(); OcHeaderOption apiVersion = new OcHeaderOption(StringConstants.API_VERSION_KEY, diff --git a/android/examples/guiclient/src/main/java/org/iotivity/guiclient/OcWorker.java b/android/examples/guiclient/src/main/java/org/iotivity/guiclient/OcWorker.java index 3268857d08..f8b5d519db 100644 --- a/android/examples/guiclient/src/main/java/org/iotivity/guiclient/OcWorker.java +++ b/android/examples/guiclient/src/main/java/org/iotivity/guiclient/OcWorker.java @@ -503,7 +503,7 @@ public class OcWorker extends Thread Log.d(TAG, String.format("discoverResources(): Calling OcPlatform.findResource(%s)", s)); OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + s, - OcConnectivityType.IPV4, + OcConnectivityType.CT_DEFAULT, this); } } catch (OcException e) { diff --git a/android/examples/simpleclient/src/main/java/org/iotivity/base/examples/simpleclient/SimpleClient.java b/android/examples/simpleclient/src/main/java/org/iotivity/base/examples/simpleclient/SimpleClient.java index 472d206ee9..dafe16adf6 100644 --- a/android/examples/simpleclient/src/main/java/org/iotivity/base/examples/simpleclient/SimpleClient.java +++ b/android/examples/simpleclient/src/main/java/org/iotivity/base/examples/simpleclient/SimpleClient.java @@ -70,15 +70,15 @@ import base.iotivity.org.examples.message.IMessageLogger; */ public class SimpleClient extends Activity implements OcPlatform.OnResourceFoundListener, IMessageLogger { - private static final String TAG = "SimpleClient: "; + private static final String TAG = "SimpleClient: "; - private static final int BUFFER_SIZE = 1024; + private static final int BUFFER_SIZE = 1024; private String filePath = ""; private Light myLight; - private OcResource curResource; + private OcResource curResource; //for display - private TextView mEventsTextView; + private TextView mEventsTextView; private static boolean printOnce = true; /** @@ -99,7 +99,7 @@ public class SimpleClient extends Activity implements OcPlatform.OnResourceFound * find all resources */ OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + "core.light", - OcConnectivityType.IPV4, this); + OcConnectivityType.CT_DEFAULT, this); } catch (OcException e) { logMessage(TAG + "findResource error: " + e.getMessage()); Log.e(TAG, e.getMessage()); -- GitLab