Hello, In the C++ API (iotivity/resource/include/OCPlatform.h), the findResource() method uses a callback (parameter 'resourceHandler') for each resource that has been discovered.
As opposed to this, in the C API (iotivity/resource/csdk/stack/ocstack.h), the OCDoResource function has a 'cbData' callback invoked when the discovery is complete, and provides the list of discovered resources. AFAIK at protocol level, discovery is done by a GET request to 'oic/res', therefore the C API is correctly exposing this. Since the results come in a list anyway, the iterative approach of the C++ API does not bring any performance benefits on the client side, but it is missing the information when discovery has ended. As a solution, the C++ API should also use a callback invoked with the returned list. This same problem affects device discovery. I have created an issue for tracking this: https://jira.iotivity.org/browse/IOT-678 Best regards, Zoltan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150808/fc1863ec/attachment.html>
