summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authortick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-10-25 11:53:03 +0000
committertick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-10-25 11:53:03 +0000
commitbd3f1498ccd05a9aac192f84bf3f40189ff3a0d6 (patch)
tree3eef8200b89bab0faa61b58857290d8cfd7c0919 /src/util
parentb8b0521b4e9e021600411182f0b0b9a4e7f7c284 (diff)
handle CME and CMS errors (Erin Yueh)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3267 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r--src/util/event.c12
1 files changed, 11 insertions, 1 deletions
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;
}
personal git repositories of Harald Welte. Your mileage may vary