iotivity-lite icon indicating copy to clipboard operation
iotivity-lite copied to clipboard

In MultiDeviceServer with iotivity-lite v2.2.4.3, ownership setting (e.g. JW OTM) fails from the second device onwards.

Open Askidea opened this issue 2 years ago • 1 comments

Using Android apps, MultiDeviceServer and OnBoardingTool with iotivity-lite v2.2.4.3 or later, OTM failed from 2nd device. OTM to the first device is OK, but OTM to the second device fails regardless of the OTM type.

In iotivity-lite v2.2.0, OTM was successful for all devices added in MultiDeviceServer.

What changes have occurred since the iotivity-lite version was upgraded?

[ MultiDeviceServer customized ] image

[ OnBoardingTool] image

Askidea avatar Aug 26 '22 06:08 Askidea

I think I found the source of the issue - https://github.com/iotivity/iotivity-lite/commit/c9e97deac32a1ff989101c4ec8a6fb78fcd285a3 .

The problem is that for multicasts the get doxm handler uses static buffer that's shared by all devices (static oc_separate_response_t doxm_separate_response). When you have multiple devices they all want to use the single buffer and just overwrite it. I'll discuss the solution with @jkralik once he returns from vacation. (And you can see in this commit that a random jitter was added to the response time, so that answers the question from the other ticket why the discover responses come in small random intervals.)

Danielius1922 avatar Aug 31 '22 11:08 Danielius1922

@Askidea should be fixed in master now.

Danielius1922 avatar Sep 09 '22 12:09 Danielius1922