> My "dream logic":
>
> First, the app finds the devices and identify them using the unique ID
> (assuming the app logic needs to "remember" something about the devices, and
> not just find them).
> Then, find the respective resources of the devices, so the app can control
> the device.
>
> Unfortunately, failed to understand from the samples how it can be done.
>
> Looking in the Android code:
> Resource discovery is done via OcPlatform.findResource(),
> Device discovery is done via OcPlatform.getDeviceInfo().
Hello,
below is a description of the flow that would be required when trying to find
the resources for a specific server:
1.OcPlatform.getDeviceInfo()
2.onDeviceFound(OcRepresentation ocRepresentation)
3.OcPlatform.findResource(<HostURI>, ...)
e.g.:
OcPlatform.getDeviceInfo("",
OcPlatform.WELL_KNOWN_DEVICE_QUERY,
EnumSet.of(OcConnectivityType.CT_IP_USE_V4),
<OcPlatform.OnDeviceFoundListener>);
The <listener> would then have an implementation of
onDeviceFound(OcRepresentation ocRepresentation);