Narrowed it down to something as simple as this (Sorry for the C# syntax but it
should be almost identical to C):
string resourceTypeName = "oic.r.switch.binary";
string resourceInterfaceName = "oic.if.baseline";
OCStackResult result = OCCreateResource(out _handle,
resourceTypeName, resourceInterfaceName,
"/switch/1", null, IntPtr.Zero,
OCResourceProperty.OC_DISCOVERABLE | OCResourceProperty.OC_OBSERVABLE);
result = OCCreateResource(out _handle, resourceTypeName,
resourceInterfaceName,
"/switch/2", null, IntPtr.Zero,
OCResourceProperty.OC_DISCOVERABLE | OCResourceProperty.OC_OBSERVABLE);
result = OCCreateResource(out _handle, resourceTypeName ,
resourceInterfaceName,
"/switch/3", null, IntPtr.Zero,
OCResourceProperty.OC_DISCOVERABLE | OCResourceProperty.OC_OBSERVABLE);
result = OCCreateResource(out _handle, resourceTypeName,
resourceInterfaceName,
"/switch/4", null, IntPtr.Zero,
OCResourceProperty.OC_DISCOVERABLE | OCResourceProperty.OC_OBSERVABLE);
And then basically perform a discovery request:
OCStackResult result = OCDoResource(out handle,
OCMethod.OC_REST_DISCOVER, "/oic/res", null, IntPtr.Zero,
OCConnectivityType.CT_DEFAULT, OCQualityOfService.OC_LOW_QOS, cbData, null, 0);
With 3 resources, everything works OK. The moment I add a 4th, the callback
handler from the discovery stops being called, and internally I?m seeing these
response errors, which in the end gets swallowed and thus never calls the
handler. Was trying to build a Z-Wave bridge, and I have quite a few more
Z-wave devices than 3 ??
I?m running off the latest code-base in Master (Windows x64 and x86) .
/Morten
From: Morten Nielsen<mailto:[email protected]>
Sent: Saturday, January 7, 2017 1:19 PM
To: iotivity-dev at lists.iotivity.org<mailto:iotivity-dev at
lists.iotivity.org>
Subject: [dev] Discovery failure with multiple resources
I?m seeing a strange problem when I add 3-4 resources to my device. My code
runs great with 1-2 devices, but once I add a 3-4 resources, the resource
Discovery starts failing (sometimes 3, but always when there?s 4+ resources).
I?ve used the WIKI here to run the discovery:
https://wiki.iotivity.org/resource_find_registration and quering for ?/oic/res".
Digging a bit into where it?s failing, in OCHandleResponse the
responseInfo.Result == CA_REQUEST_ENTITY_INCOMPLETE , causing the Discovery
Payload later to be null and return out.
If I run ?resource\csdk\stack\samples\linux\SimpleClientServer\occlient.exe -t
1? , this sample will actually discover all my resources, but it seems to me it
uses a different discovery approach than what is used in the wiki.
Is there a known issue here or could I be doing something wrong?
Thanks
/Morten
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170108/f945e3ab/attachment.html>