From bd3f1498ccd05a9aac192f84bf3f40189ff3a0d6 Mon Sep 17 00:00:00 2001 From: tick Date: Thu, 25 Oct 2007 11:53:03 +0000 Subject: handle CME and CMS errors (Erin Yueh) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3267 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/event.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/event.c b/src/util/event.c index f14f906..acbd24a 100644 --- a/src/util/event.c +++ b/src/util/event.c @@ -233,6 +233,16 @@ static int cprog_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdat return 0; } +static int error_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux) +{ + if(aux->u.cme_err.number) + printf("cme error: %u\n", aux->u.cme_err.number); + else if(aux->u.cms_err.number) + printf("cme error: %u\n", aux->u.cms_err.number); + + return 0; +} + int event_init(struct lgsm_handle *lh) { int rc; @@ -246,7 +256,7 @@ int event_init(struct lgsm_handle *lh) rc |= lgsm_evt_handler_register(lh, GSMD_EVT_NETREG, &netreg_handler); rc |= lgsm_evt_handler_register(lh, GSMD_EVT_SIGNAL, &sigq_handler); rc |= lgsm_evt_handler_register(lh, GSMD_EVT_OUT_STATUS, &cprog_handler); - + rc |= lgsm_evt_handler_register(lh, GSMD_EVT_IN_ERROR, &error_handler); return rc; } -- cgit v1.2.3