Hello,

I just tried what you suggested (if I understood correctly):
Modified server_riot.c with oc_resource_set_periodic_observable(res, 10)
(notify every 10s)
and the client with oc_set_delayed_callback(NULL, &stop_observe, 60)
(keep-alive of 60s
waiting for notifications) so that we see more updates.

I built server_riot with the ?native? BSP and tested against client_linux
and it works OK 
i.e. client gets notified every 10s. Instructions for setting up tap
interface are in the README.

Are you running the server on some RIOT target? I wonder if its BSP
implementation is
doing something different from RIOT's native BSP.

Regarding timers, there are two key hooks: 1) In config.h which sets the
precision
with which to track time using OC_CLOCK_CONF_TICKS_PER_SECOND, and the
timestamp field
width which maps to oc_clock_time_t (how time is stored inside
time-keeping structures),
2) In clock.c which calls into the OS?s APIs to return current time in
terms of clock ticks.

In a working implementation (i.e. IoTivity-Constrained?s port -> OS ->
BSP), 
successive calls to oc_clock_time() separated by a certain period would
return timestamps differing by those many ticks. If it somehow doesn?t,
then it might result in unexpected
behaviors. 

Hope this gives you enough information to chase down the issue.
Please feel free to suggest enhancements to the RIOT OS port (port/riot/*)
if you think of any.

-Kishen.



-
Kishen Maloor
Intel Open Source Technology Center




From:  <[email protected]> on behalf of MATTIA
ANTONINI <mattia.antonini1 at studenti.unipr.it>
Date:  Wednesday, October 26, 2016 at 7:44 AM
To:  "iotivity-dev at lists.iotivity.org" <iotivity-dev at lists.iotivity.org>
Subject:  [dev] IoTivity Constrained Timers


Dear All,
I'm working with IoTivity-Constrained on RIOT-OS. I tested the server part
(GETs and PUTs) but now I'm dealing with the Observe. In the available
example, the server creates an observable resource and it should send
notifications every N seconds. The problem,
 I think, is related to timers firing (Timers are ported from Contiki).
For example, if I create a delayed callback (just a keep alive) and it is
executed every second the Observing mechanism works (and the notifications
are sent). If the delay of the keep-alive
 callback is 10 seconds nothing works. I tried also the "classical"
observing but it does not work ( I call the notification function when the
resource is changed).

I tried to investigate how it works, but I have no luck... Any Suggestion?

Cheers,

Mattia Antonini

Reply via email to