dotstack API Reference  1.10.37
Typedefs | Functions
OEM - Timer Interface


typedef void(* bt_timer_callback_fp) (void)
 Timer callback. More...


void bt_oem_timer_set (bt_uint timerId, bt_ulong milliseconds, bt_timer_callback_fp callback)
 Set timer. More...
void bt_oem_timer_clear (bt_uint timerId)
 Clear timer. More...

Detailed Description

DotStack requires a facility to measure various time intervals. This module declares an interface that the application has to implement in order to provide DotStack with such functionality.

The minimum required timer resolution is 100 milliseconds.

The maximum number of timers is defined by the BT_TIMER_MAX constant.

Timer ID values used in the interface are from 0 to BT_TIMER_MAX-1.

The interface consists of the following function:

Typedef Documentation

typedef void(* bt_timer_callback_fp) (void)

Timer callback.

This callback is called when a timer expires.

Function Documentation

void bt_oem_timer_clear ( bt_uint  timerId)

Clear timer.

This function must be implemented by the application. When this function is called the application must clear the specified timer. If it is already expired and a callback is currently pending, the application should also take measures to cancel the callback.

timerIdID of the timer to clear.
void bt_oem_timer_set ( bt_uint  timerId,
bt_ulong  milliseconds,
bt_timer_callback_fp  callback 

Set timer.

This function must be implemented by the application. When it is called, the application must set the specified timer. When the timer expires, the application must call the passed callback function. The function must not wait until the timer expires. It must set the timer and exit immediately.

timerIdID of the timer to set.
millisecondsTimer interval in milliseconds
callbackTimer expiration callback function.