NUGU SDK Linux  1.7.6

Timer manipulation functions. More...

+ Collaboration diagram for Timer:

Typedefs

typedef void(* NuguTimeoutCallback) (void *userdata)
 Callback prototype for timeout.
 
typedef struct _nugu_timer NuguTimer
 Timer object.
 

Functions

NUGU_API void nugu_timer_delete (NuguTimer *timer)
 Destroy the timer object. More...
 
NUGU_API long nugu_timer_get_interval (NuguTimer *timer)
 Get interval. More...
 
NUGU_API int nugu_timer_get_singleshot (NuguTimer *timer)
 Get timer single shot property. More...
 
NUGU_API NuguTimernugu_timer_new (long interval)
 Create new timer object. More...
 
NUGU_API void nugu_timer_set_callback (NuguTimer *timer, NuguTimeoutCallback callback, void *userdata)
 Set timeout callback. More...
 
NUGU_API void nugu_timer_set_interval (NuguTimer *timer, long interval)
 Set interval. More...
 
NUGU_API void nugu_timer_set_singleshot (NuguTimer *timer, int singleshot)
 Set timer running single shot. More...
 
NUGU_API void nugu_timer_start (NuguTimer *timer)
 Start the timer. More...
 
NUGU_API void nugu_timer_stop (NuguTimer *timer)
 Stop the timer. More...
 

Detailed Description

Timer manipulation functions.

Timer manipulation functions

Function Documentation

◆ nugu_timer_new()

NUGU_API NuguTimer* nugu_timer_new ( long  interval)

Create new timer object.

Parameters
[in]intervalinterval seconds
Returns
timer object

◆ nugu_timer_delete()

NUGU_API void nugu_timer_delete ( NuguTimer timer)

Destroy the timer object.

Parameters
[in]timertimer object

◆ nugu_timer_set_interval()

NUGU_API void nugu_timer_set_interval ( NuguTimer timer,
long  interval 
)

Set interval.

Parameters
[in]timertimer object
[in]intervalinterval seconds
See also
nugu_timer_get_interval()

◆ nugu_timer_get_interval()

NUGU_API long nugu_timer_get_interval ( NuguTimer timer)

Get interval.

Parameters
[in]timertimer object
Returns
interval
See also
nugu_timer_set_interval()

◆ nugu_timer_set_singleshot()

NUGU_API void nugu_timer_set_singleshot ( NuguTimer timer,
int  singleshot 
)

Set timer running single shot.

Parameters
[in]timertimer object
[in]singleshotBy setting the singleshot to 1, you can trigger the timer only once. The default value of singleshot is 0, and the timer runs repeatedly.
See also
nugu_timer_get_singleshot()

◆ nugu_timer_get_singleshot()

NUGU_API int nugu_timer_get_singleshot ( NuguTimer timer)

Get timer single shot property.

Parameters
[in]timertimer object
Returns
single shot value
See also
nugu_timer_set_singleshot()

◆ nugu_timer_start()

NUGU_API void nugu_timer_start ( NuguTimer timer)

Start the timer.

Parameters
[in]timertimer object
See also
nugu_timer_stop()

◆ nugu_timer_stop()

NUGU_API void nugu_timer_stop ( NuguTimer timer)

Stop the timer.

Parameters
[in]timertimer object
See also
nugu_timer_start()

◆ nugu_timer_set_callback()

NUGU_API void nugu_timer_set_callback ( NuguTimer timer,
NuguTimeoutCallback  callback,
void *  userdata 
)

Set timeout callback.

Parameters
[in]timertimer object
[in]callbackcallback function
[in]userdatadata to pass to the user callback