From cbffc8d64707828b045b679e8db0269ae362ffcf Mon Sep 17 00:00:00 2001 From: laforge Date: Mon, 23 Oct 2006 20:28:37 +0000 Subject: more gsmd/libgsm implementation git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@114 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/event.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/util/event.c (limited to 'src/util/event.c') 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 +#include + +#include +#include + +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; +} + -- cgit v1.2.3