problem with timer

i want made timer for receveid message each second
but code doesn’t work
why ?
thanks,

int
timer_events(RtTimer_t *timer,void *data)
{
printf(“received timer event\n”);

return 0;
}

RtTimer_t *ct = RtTimerCreate(CLOCK_REALTIME,0,(RtTimerCbF_t
*)&timer_events,NULL);

struct itimerspec ki = {0};

ki.it_value.tv_nsec = 1000000;
ki.it_interval.tv_nsec = 1000000; //send message each seconds

RtTimerSetTime(ct,0,&ki,NULL);

Hey rgb

What version of photon are you using?

Thanks
Rodney

rgb <rgb@free.fr> wrote:

i want made timer for receveid message each second
but code doesn’t work
why ?
thanks,

int
timer_events(RtTimer_t *timer,void *data)
{
printf(“received timer event\n”);

return 0;
}

RtTimer_t *ct = RtTimerCreate(CLOCK_REALTIME,0,(RtTimerCbF_t
*)&timer_events,NULL);

struct itimerspec ki = {0};

ki.it_value.tv_nsec = 1000000;
ki.it_interval.tv_nsec = 1000000; //send message each seconds

RtTimerSetTime(ct,0,&ki,NULL);

Qnx RTP 6.1
thanks,


Gui Group <gui@qnx.com> a écrit dans l’article
<9tdlc7$obc$1@nntp.qnx.com>…

Hey rgb

What version of photon are you using?

Thanks
Rodney

Hey rgb


Instead of passing 0 in to the call for the priority, pass in -1.
One of the developers tried it here and that was the way that he got
it to work. Also he asked me to point out that 1000000 nanoseconds
is 1ms, not 1 second; to specify one second, he’d have to put zero
in tv_nsec and 1 in tv_sec.

Hope this helps
Rodney

rgb <rgb@free.fr> wrote:

Qnx RTP 6.1
thanks,



Gui Group <> gui@qnx.com> > a écrit dans l’article
9tdlc7$obc$> 1@nntp.qnx.com> >…
Hey rgb

What version of photon are you using?

Thanks
Rodney

Gui Group <gui@qnx.com> wrote:
: Instead of passing 0 in to the call for the priority, pass in -1.
: One of the developers tried it here and that was the way that he got
: it to work.

I’ll update the docs.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

thanks,


Steve Reid <stever@qnx.com> a écrit dans l’article
<9tgnba$n5u$1@nntp.qnx.com>…

Gui Group <> gui@qnx.com> > wrote:
: Instead of passing 0 in to the call for the priority, pass in -1.
: One of the developers tried it here and that was the way that he got
: it to work.

I’ll update the docs.


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems