diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2006-10-23 20:28:37 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2006-10-23 20:28:37 +0000 |
commit | cbffc8d64707828b045b679e8db0269ae362ffcf (patch) | |
tree | 9ba71c11b92600548581af9d582a2c1feb18473f /src/util/event.c | |
parent | 7fe163099476937a14dd7a0714de542f7f94f665 (diff) |
more gsmd/libgsm implementation
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@114 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util/event.c')
-rw-r--r-- | src/util/event.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/util/event.c b/src/util/event.c new file mode 100644 index 0000000..601ea9a --- /dev/null +++ b/src/util/event.c @@ -0,0 +1,38 @@ +#include <stdio.h> +#include <string.h> + +#include <libgsmd/libgsmd.h> +#include <libgsmd/event.h> + +static int incall_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux) +{ + printf("EVENT: Incoming call type=%u!\n", aux->u.call.type); + + return 0; +} + +static int clip_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux) +{ + printf("EVENT: Incoming call clip=`%s'\n", aux->u.clip.addr.number); + + return 0; +} + +static int netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux) +{ + printf("EVENT: Netreg\n"); + + return 0; +} + +int event_init(struct lgsm_handle *lh) +{ + int rc; + + rc = lgsm_evt_handler_register(lh, GSMD_EVT_IN_CALL, &incall_handler); + rc |= lgsm_evt_handler_register(lh, GSMD_EVT_IN_CLIP, &clip_handler); + rc |= lgsm_evt_handler_register(lh, GSMD_EVT_NETREG, &netreg_handler); + + return rc; +} + |