From 348c9af2fce8d0d53341d9861494b5c13f9796f1 Mon Sep 17 00:00:00 2001 From: laforge Date: Fri, 17 Aug 2007 08:29:08 +0000 Subject: From: Andrzej Zaborowski Date: Thu, 26 Jul 2007 00:32:38 +0200 Subject: [PATCH] SMSC and Preferred Storage operations. This adds setting and retrieval of SMS storage stats (memory type, used entries, all entries), and of the default service centre (SMSC) number for outgoing messages. The operation of setting a new SMSC number is untested because my SIM doesn't seem to allow this (that or I did something wrong). New "libgmsd-tool -m shell" commands for testing are also added. Other changes in this patch: * The third, optional, parameter to +CMGL: is a string, not an integer as I wrongly assumed earlier, this is now corrected. * Rename libgsmd API functions starting with lgsmd_.. to lgsm_.. for consistency with all other identifiers. * Move lgsm_send_simple() to libgsmd.c and add a prototype in lgsm_internals.h, this eliminates some compile-time warnings. git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2720 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/libgsmd/libgsmd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/libgsmd/libgsmd.c') diff --git a/src/libgsmd/libgsmd.c b/src/libgsmd/libgsmd.c index 11760b4..37a50e6 100644 --- a/src/libgsmd/libgsmd.c +++ b/src/libgsmd/libgsmd.c @@ -207,3 +207,20 @@ struct gsmd_msg_hdr *lgsm_gmh_fill(int type, int subtype, int payload_len) return gmh; } +int lgsm_send_simple(struct lgsm_handle *lh, int type, int sub_type) +{ + struct gsmd_msg_hdr *gmh; + int rc; + + gmh = lgsm_gmh_fill(type, sub_type, 0); + if (!gmh) + return -ENOMEM; + rc = lgsm_send(lh, gmh); + if (rc < gmh->len + sizeof(*gmh)) { + lgsm_gmh_free(gmh); + return -EIO; + } + lgsm_gmh_free(gmh); + + return 0; +} -- cgit v1.2.3