Hi Kishen,
Thank you for the reply and advices. You?re right. There seems to be a problem
on the client side. We use a rest-api-server to monitor the OCF-resources.
It discovers the resources and registers itself as a client to observe the
changes. I used the client_linux to test and it could detect the resource types
types on the Arduino 101.
Thanks,
Kien
On 2017/04/07 8:16, "Maloor, Kishen" <kishen.maloor at intel.com> wrote:
Hello Kien,
> I tweaked the ?apps/server_zephyr.c? as following to
> bind a new temperature type. However, I could only
> see the first one,
When you say ?you? could see, I assume you?re talking
about a client application :-) You should probably
revisit your client logic (not sure if you?re using
IoTivity or IoTivity-Constrained for that)
because if you bound two resource types to a resource
on the server in the manner you described, they should most
certainly show on your client during discovery.
By the way, I just quickly tried what you did on my
end (by updating client_linux), and could see the two.
> would like to map each sensor to a standard type so
> that the device can have multiple resource types at
> the same time
If you?re exposing two distinct physical resources,
you should probably be creating two separate logical resources
inside the register_resources() callback, one for each physical
resource. This way you could attach separate handlers to each.
> However, so far it seemed that iotivity-constrained
> only allowed binding to one.
?Binding? a logical resource to multiple resource
types (which the stack does support) is generally
different from what you?re trying to do.
You might want to bind multiple resource types when the
two resource types largely overlap in their data
models, or if may be one conveys the other in some way.
-
Kishen Maloor
Intel Open Source Technology Center
From: <iotivity-dev-bounces at lists.iotivity.org> on behalf of "Dinh, Kien
T" <kien.t.dinh at intel.com>
Date: Wednesday, April 5, 2017 at 6:21 AM
To: "iotivity-dev at lists.iotivity.org" <iotivity-dev at
lists.iotivity.org>
Subject: [dev] iotivity-constrained: binding multiple types
Kien