From 028df7942f5ac593e116aac0d192d8a8201e8093 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 2 Jun 2007 13:45:46 +0000 Subject: Add 'modem alive' detection. We inquire every five minutes if the modem is still alive. git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2130 99fdad57-331a-0410-800a-d7fa5415bdb3 --- include/gsmd/gsmd.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/gsmd') diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h index 65ca568..b4dfa62 100644 --- a/include/gsmd/gsmd.h +++ b/include/gsmd/gsmd.h @@ -98,6 +98,27 @@ void __gsmd_log(int level, const char *file, int line, const char *function, con extern int gsmd_simplecmd(struct gsmd *gsmd, char *cmdtxt); +/*********************************************************************** + * timer handling + ***********************************************************************/ + +struct gsmd_timer { + struct llist_head list; + struct timeval expires; + void (*cb)(struct gsmd_timer *tmr, void *data); + void *data; +}; + +int gsmd_timer_init(void); +void gmsd_timer_check_n_run(void); + +struct gsmd_timer *gsmd_timer_alloc(void); +int gsmd_timer_register(struct gsmd_timer *timer); +void gsmd_timer_unregister(struct gsmd_timer *timer); + +struct gsmd_timer *gsmd_timer_create(struct timeval *expires, + void (*cb)(struct gsmd_timer *tmr, void *data), void *data); +#define gsmd_timer_free(x) talloc_free(x) #endif /* __GSMD__ */ #endif /* _GSMD_H */ -- cgit v1.2.3