Commit dc4f1d21 authored by Rahul Rahul's avatar Rahul Rahul Committed by Erich Keane

Updated android examples to use OcConnectivityType.CT_DEFAULT since

IPV4 is no longer supported

Change-Id: Ie158c53924d934cd83450297e125c61d71b6bc79
Signed-off-by: default avatarRahul Rahul <rahul.rahul@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1677Reviewed-by: default avatarErich Keane <erich.keane@intel.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
parent bdc57515
......@@ -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<String> 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<OcHeaderOption> headerOptions = new LinkedList<>();
OcHeaderOption apiVersion = new OcHeaderOption(StringConstants.API_VERSION_KEY,
......
......@@ -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) {
......
......@@ -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());
......
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