diff options
Diffstat (limited to 'nci/jni/IntervalTimer.h')
-rw-r--r-- | nci/jni/IntervalTimer.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nci/jni/IntervalTimer.h b/nci/jni/IntervalTimer.h new file mode 100644 index 0000000..0f1095f --- /dev/null +++ b/nci/jni/IntervalTimer.h @@ -0,0 +1,29 @@ +/***************************************************************************** +** +** Name: IntervalTimer.h +** +** Description: Asynchronous interval timer. +** +** Copyright (c) 2012, Broadcom Corp., All Rights Reserved. +** Proprietary and confidential. +** +*****************************************************************************/ + +#include <time.h> + + +class IntervalTimer +{ +public: + typedef void (*TIMER_FUNC) (union sigval); + + IntervalTimer(); + ~IntervalTimer(); + bool set(int ms, TIMER_FUNC cb); + void kill(); + bool create(TIMER_FUNC ); + +private: + timer_t mTimerId; + TIMER_FUNC mCb; +}; |