summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-08-16 04:20:03 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-08-16 04:20:03 +0000
commitf5423c22b8e60bd9ddd05695135ed0713ae07143 (patch)
tree5438dc32053b6f2927ac0c096a4b12215007ad4b /src/util
parent66ddffab0a8fe2f517d83859ffb20467acd0cbe6 (diff)
From 5b7c50fd08b8f76f761958c8a8243e6c23118fa3 Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org> Date: Thu, 12 Jul 2007 14:26:46 +0200 Subject: [PATCH] Incoming SMS events This is a proposed patch to emit a gsmd event when a new SMS arrives, also modifies libgsmd-tool to display the notification. It makes sms_cb.c compile but only really implements the bits necessary to make it build and for the notifications to work. I chose AT+CNMI mode 1 (i.e. store messages in memory and report the location through +CMTI, rather than print the message right away through +CMT) because the parser doesn't support multiline unsolicited responses - in fact it can't support those because in a situation when a normal command is executing and an unsolicited response comes in (which is the case when sending a message to yourself) it is impossible for the parser to distinguish whether the line after the unsolicited response is part of that response or part of the command's response. git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2711 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r--src/util/event.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/event.c b/src/util/event.c
index 0fe6472..209d34b 100644
--- a/src/util/event.c
+++ b/src/util/event.c
@@ -34,6 +34,13 @@ static int incall_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxda
return 0;
}
+static int insms_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
+{
+ printf("EVENT: Incoming SMS stored at location %i\n", aux->u.sms.index);
+
+ 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);
@@ -131,6 +138,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_IN_SMS, &insms_handler);
rc |= lgsm_evt_handler_register(lh, GSMD_EVT_OUT_COLP, &colp_handler);
rc |= lgsm_evt_handler_register(lh, GSMD_EVT_NETREG, &netreg_handler);
rc |= lgsm_evt_handler_register(lh, GSMD_EVT_SIGNAL, &sigq_handler);
personal git repositories of Harald Welte. Your mileage may vary