On Tue, Feb 9, 2016 at 11:04 PM, Salvatore Iovene <
salvatore.iovene at gmail.com> wrote:

> On 09 Feb 2016, at 17:30, Thiago Macieira <thiago.macieira at intel.com>
> wrote:
>
> On ter?a-feira, 9 de fevereiro de 2016 11:32:35 PST Salvatore Iovene wrote:
>
> Hi,
> I'm using the Java API to discover devices via the "getDeviceInfo"
> method on OcPlatform.
>
> Is there a way to get the devices URL from its OcRepresentation? I
> read all the way down to the C stack and it looks like only the
> following keys are set in the payload:
>
> OC_RSRVD_DEVICE_ID,
> OC_RSRVD_DEVICE_NAME,
> OC_RSRVD_SPEC_VERSION
> OC_RSRVD_DATA_MODEL_VERSION
>
> (see here:
> https://github.com/iotivity/iotivity/blob/1.0.1/resource/csdk/stack/src/ocp
> ayloadconvert.c#L425 )
>
> Am I missing something?
>
>
> Hi Salvatore
>
> Why do you need the URL?
>
>
> I?m implementing this:
> https://github.com/otcshare/iotivity-node/blob/master/spec/iot-js-spec.md
>

> And the corresponding device in this JavaScript API has a URL.
>
> Technically, if you have the device name, you have the URL, by composing it
>
> like "oic://<device-id-with-dashes>?.
>
>
> Zoltan, would it be okay to build the URL like that in OicDevice?
>

Sorry for noticing this late. IIRC the URL property was meant to have the
IP address and port, if that would be of interest to JS clients. I agree
that a single 'url' property is less clear than using an explicit 'address'
and 'port', but it's usually preferred in the JS world.

However, IMO we should not need that in the high level OIC JS API: the
device id and the resource path should be enough to get OIC protocol
operations done. The device id is an opaque string to the JS apps, and the
apps should not need to construct URLs out of it.

Thiago if you agree with the above, I would remove the 'url' property from
OicDevice, and then also change the presence API:
https://github.com/otcshare/iotivity-node/blob/master/spec/iot-js-spec.md#oic-presence
<https://github.com/otcshare/iotivity-node/blob/master/spec/iot-js-spec.md>
namely, the optional 'USVString url' parameter to 'subscribe()' and
'unsubscribe()' would become an explicit
'USVString deviceId'.

Best regards,
Zoltan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160211/b6d3b9e4/attachment.html>

Reply via email to