0

how to use AJ_SetTimer()

asked 2016-01-19 01:47:49 -0700

gene gravatar image

hi, how to use AJ_SetTimer(); in my code I use as (timer_id = AJ_SetTimer(CB_TIMEOUT, &AppDoWork, NULL, CB_TIMEOUT);)but the AppDoWork do not run! CB_TIMEOUT is 2000.

static void AppDoWork(void* context) { /* * This function is called if there are no messages to unmarshal */ AJ_Status status; AJ_Printf("do work\n"); status = SendSignal(); if(status == AJ_OK) AJ_Printf("SendSignal return AJ_OK\n"); else if(status == AJ_ERR_MARSHAL) AJ_Printf("SendSignal return AJ_ERR_MARSHAL\n"); else if(status == AJ_ERR_WRITE) AJ_Printf("SendSignal return AJ_ERR_WRITE\n"); }

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2016-01-19 22:41:25 -0700

gene gravatar image

I found the reason,AJ_SetTimer() must use with the AJ_RunAllJoynService().

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2016-01-19 01:47:49 -0700

Seen: 159 times

Last updated: Jan 19 '16