dotstack API Reference
1.10.37
|
Typedefs | |
typedef void(* | bt_timer_callback_fp) (void) |
Timer callback. More... | |
Functions | |
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... | |
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 void(* bt_timer_callback_fp) (void) |
Timer callback.
This callback is called when a timer expires.
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.
timerId | ID 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.
timerId | ID of the timer to set. |
milliseconds | Timer interval in milliseconds |
callback | Timer expiration callback function. |