From 23dfcf4ff925f61bcb2c3bdd712ff0f70bde4fcb Mon Sep 17 00:00:00 2001 From: laforge Date: Tue, 24 Oct 2006 13:07:08 +0000 Subject: - clean up header files (all in include/gmsd now) - finish vendor plugin support - add call progress indicator and signal quality unsolicited support to vendor_ti.c git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@120 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/atcmd.c | 2 ++ src/util/event.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src/util') diff --git a/src/util/atcmd.c b/src/util/atcmd.c index 6cf9aa7..61f7032 100644 --- a/src/util/atcmd.c +++ b/src/util/atcmd.c @@ -44,6 +44,8 @@ int atcmd_main(struct lgsm_handle *lgsmh) break; } rc = lgsm_handle_packet(lgsmh, buf, rc); + if (rc < 0) + printf("ERROR processing packet: %d(%s)\n", rc, strerror(rc)); } if (FD_ISSET(0, &readset)) { /* we've received something on stdin. send it as passthrough diff --git a/src/util/event.c b/src/util/event.c index 0f09d47..bff895d 100644 --- a/src/util/event.c +++ b/src/util/event.c @@ -6,14 +6,14 @@ 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); + 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); + printf("EVENT: Incoming call clip = %s\n", aux->u.clip.addr.number); return 0; } @@ -41,15 +41,21 @@ static int netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxda } if (aux->u.netreg.lac) - printf("LocationAreaCode=0x%04X ", aux->u.netreg.lac); + printf("LocationAreaCode = 0x%04X ", aux->u.netreg.lac); if (aux->u.netreg.ci) - printf("CellID=0x%04X ", aux->u.netreg.ci); + printf("CellID = 0x%04X ", aux->u.netreg.ci); printf("\n"); return 0; } +static int sigq_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux) +{ + printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi); + return 0; +} + int event_init(struct lgsm_handle *lh) { int rc; @@ -57,6 +63,7 @@ int event_init(struct lgsm_handle *lh) 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); + rc |= lgsm_evt_handler_register(lh, GSMD_EVT_SIGNAL, &sigq_handler); return rc; } -- cgit v1.2.3