Thanks for sharing this - then someone please update the C API comments/documentation, in order to reflect the actual behaviour. Please check if the assumptions in the following comment on the JIRA issue is correct: https://jira.iotivity.org/browse/IOT-678?focusedCommentId=11901
Thanks, Zoltan On Mon, Aug 10, 2015 at 8:14 PM, Lankswert, Patrick < patrick.lankswert at intel.com> wrote: > Charlie, > > > > That is correct. Discovery is over when you find the resource that you are > looking for or you time out. > > > > Pat > > > > *From:* iotivity-dev-bounces at lists.iotivity.org [mailto: > iotivity-dev-bounces at lists.iotivity.org] *On Behalf Of *Lenahan, Charlie > *Sent:* Monday, August 10, 2015 1:02 PM > *To:* Kis, Zoltan; iotivity-dev at lists.iotivity.org > *Subject:* Re: [dev] C++ API inconsistent on discovery (IOT-678) > > > > 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: *<iotivity-dev-bounces at lists.iotivity.org> 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/cd83c98a/attachment.html>
