Unless something has changed recently , the OCDoResource does the callback
for each item discovered.

My understanding is that is no way to know when the discovery is ?complete?
(at least for low qos) because its just blatting out a ?who?s there? and the
?discovery callback? stays registered until another discovery call, or
OCCancel.

From:  <[email protected]> on behalf of "Kis, Zoltan"
<zoltan.kis at intel.com>
Date:  Saturday, August 8, 2015 at 6:23 AM
To:  "iotivity-dev at lists.iotivity.org" <iotivity-dev at lists.iotivity.org>
Subject:  [dev] C++ API inconsistent on discovery (IOT-678)

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/20150810/92cbf27c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5859 bytes
Desc: not available
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150810/92cbf27c/attachment.p7s>

Reply via email to