Commit 4a6a779d authored by Larry Sachs's avatar Larry Sachs

Don't track /oic/d for cancel observe

This change is necessary to work with OCF light servers.

Change-Id: I055c1ae95b3ebdba06de79a68abca7effcd2ab2c
Signed-off-by: Larry Sachs's avatarLarry Sachs <larry.j.sachs@intel.com>
parent ae7b7cb5
......@@ -165,8 +165,10 @@ public class UpnpClientActivity extends Activity implements
tracked = true;
} else {
if (!resourceUri.equals("/oic/d")) {
Log.i(TAG, "URI of the new (for now, untracked) resource: " + resourceUri);
}
}
if (tracked) {
// Call a local method which will internally invoke "get" API on the found resource
......@@ -343,6 +345,7 @@ public class UpnpClientActivity extends Activity implements
Links links = device.getLinks();
for (Link link : links.getLinks()) {
String href = link.getHref();
if (!href.equals("/oic/d")) {
// rt could be String or String[]
Object rt = link.getRt();
String rtAsString = null;
......@@ -366,6 +369,7 @@ public class UpnpClientActivity extends Activity implements
OcPlatform.findResource("", requestUri, EnumSet.of(OcConnectivityType.CT_DEFAULT), new ResourceFoundListener(ocRepUri, href));
}
}
}
if (resource instanceof Light) {
Light light = (Light) resource;
......@@ -908,6 +912,7 @@ public class UpnpClientActivity extends Activity implements
Log.i(TAG, "Cancelling Observe...");
for (OcResource resource : iotivityResources) {
try {
Log.i(TAG, "Cancelling Observe for " + resource.getUri());
resource.cancelObserve();
} catch (OcException e) {
Log.e(TAG, "Error occurred while invoking \"cancelObserve\" API -- " + e.toString(), e);
......
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