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:  <[email protected]> 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

Reply via email to