summaryrefslogtreecommitdiff
path: root/src/util/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/event.c')
-rw-r--r--src/util/event.c15
1 files changed, 11 insertions, 4 deletions
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