summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/atcmd.c2
-rw-r--r--src/util/event.c15
2 files changed, 13 insertions, 4 deletions
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;
}
personal git repositories of Harald Welte. Your mileage may vary