Thank you Uze Choi this is the exact information that I needed.

I can get most of the required information from the initial findResource  for 
the oic.d.light the rest of the information is part of the specification for 
the oic.r.switch.binary and oic.r.light.brightness found in the Smart Home 
Device specification.

This greatly simplified my code since I no longer need to wait for multiple 
callbacks to create a full representation of the light.

George

From: ???(Uze Choi) [mailto:[email protected]]
Sent: Friday, June 3, 2016 12:11 AM
To: Nash, George <george.nash at intel.com>; iotivity-dev at lists.iotivity.org
Subject: RE: [dev] Is it possible to create an OCResouce if I know the URI

Could you check
OCPlatform::constructResourceObject<https://api-docs.iotivity.org/latest/namespace_o_c_1_1_o_c_platform.html#a9e96de317c68e0da5c375503201800a1>
 (const std::string &host, const std::string &uri, 
OCConnectivityType<https://api-docs.iotivity.org/latest/octypes_8h.html#a916b07a8f92b7cd59809e83309846b4a>connectivityType,
 bool isObservable, const std::vector< std::string > &resourceTypes, const 
std::vector< std::string > &interfaces)
BR, UZe Choi
From: iotivity-dev-bounces at lists.iotivity.org<mailto:iotivity-dev-bounces at 
lists.iotivity.org> [mailto:[email protected]] On Behalf 
Of Nash, George
Sent: Friday, June 03, 2016 5:36 AM
To: iotivity-dev at lists.iotivity.org<mailto:iotivity-dev at 
lists.iotivity.org>
Subject: [dev] Is it possible to create an OCResouce if I know the URI


If I know the URI of a device can I create an OCResource without calling 
findResouce?

For example

I call
    OCPlatform::findResource(??, ?/oic/res?rt=oic.d.light?, CT_DEFAULT, 
myCallbackHandler);

I then get a response with a light resource that contains links to other 
resources:

Example:
[{
  ?rt?: ?oic.d.light?,
  ?di?: "0685B960-736F-46F7-BEC0-9E6CBD61ADC1",
  ?links?:
    [
      { ?href?: ?/light/switch?,
        ?rel?: ?contained?,
        ?rt?: ?oic.r.switch.binary?,
        ?if?: ?oic.if.a?},
      { ?href?: ?/light/brightness?,
        ?rel?: ?contained?,
        ?rt?: ?oic.r.light.brightness?,
        ?if?: ?oic.if.a?}
    ]
}]

I want to interact with the oic.r.switch.binary and the oic.r.light.brightness 
I still have OCResource for the found oic.d.light is it possible to create a 
new OCResource for the oic.r.switch.binary and oic.r.light.brightness without 
calling find for each of the contained resource types?

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160603/183a5033/attachment.html>

Reply via email to