Hi All:

I find an example in IoTivity which uses multiple resource types setting.

https://github.com/iotivity/iotivity/blob/master/service/resource-container/
examples/DiscomfortIndexSensorBundle/src/inputSensors/THSensorApp/include/Th
ingResourceServer.h



#define RESOURCE_TYPE_NAME_TEMP          "oic.r.temperature"

#define RESOURCE_TYPE_NAME_HUMID          "oic.r.humidity"

..

m_resourceUri = "/Thing_TempHumSensor";

m_resourceTypes.push_back(RESOURCE_TYPE_NAME_TEMP);

m_resourceTypes.push_back(RESOURCE_TYPE_NAME_HUMID);

m_resourceInterfaces.push_back(OC::DEFAULT_INTERFACE);



So, it seems that one resource with multiple types, such as
[oic.r.light.brightness oic.r.switch.binary], is allowed, isn't it?



Than, the following cases are all allowed, depending on the developer's
design. Is that right?

EX: Design for a device with both brightness setting and a switch:

(1) One resource: [oic.r.light.brightness oic.r.switch.binary]

(2) Two resources: [oic.r.light.brightness] and [oic.r.switch.binary]

(3) One Composite resource: XXX.r.mylight  { href:{., "rt":"
oic.r.light.brightness"}, href:{., "rt":" oic.r. switch.binary"}}





Thank you.



Best Regards,

Annie

  _____  

From: Annie Weng [mailto:annie.w...@u-media.com.tw] 
Sent: Friday, August 19, 2016 9:46 AM
To: 'iotivity-dev at lists.iotivity.org'
Subject: Question about resource with multiple resource types



Hi All:

I'm confused about multiple resource types.

According to the OIC draft spec 1.1.1, a resource could be "one or more"
resource type.

The definition of "OCResourceType" is also "link list".

So, what will be the use case of multiple resource types?

(I can only find one example: a device with types [oic.wk.d,
oic.d.airConditioner])



Will there be such kind of usage?

One resource with types [oic.r.light.brightness oic.r.switch.binary] at the
same time?

Or, one device with types [oic.wk.d oic.d.light oic.d.door] at the same
time?



If YES, what's the difference of usage between: 

(1) One resource: [oic.r.light.brightness oic.r.switch.binary]

and 

(2) Two resources: [oic.r.light.brightness] and [oic.r.switch.binary]  



If NO, what is the rule/constraint of using multiple resource types?





Thank you.



Best Regards,

Annie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160830/23ee4a00/attachment.html>

Reply via email to