G1: Add G1-specific SMS support
PATCH 3/3 G1: Add G1-specific SMS support
This is based on the atmodem SMS code, with lots of stuff dropped.
The G1's modem advertises support for CNMI mode 2, but attempting to set that actually fails. Instead, we _need_ to use mode 1. Along those lines, CNMA doesn't appear to work properly, so we disable it and use CMTI rather than CMT for PDUs. CDS notifications (for status notifications) are disabled completely.
--- Makefile.am | 3 +- plugins/g1.c | 7 +- plugins/g1sms.c | 554 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/g1sms.h | 29 +++ 4 files changed, 591 insertions(+), 2 deletions(-) create mode 100644 plugins/g1sms.c create mode 100644 plugins/g1sms.h
Makefile.am +2 -1
@@ -80,7 +80,8 @@ endif if G1MODEM builtin_modules += g1 -builtin_sources += plugins/g1.c +builtin_sources += plugins/g1.c \ + plugins/g1sms.c endif if MAINTAINER_MODE
plugins/g1.c +6 -1
@@ -33,6 +33,7 @@#include <glib.h> #include <gatchat.h> +#include "g1sms.h" #define OFONO_API_SUBJECT_TO_CHANGE #include <ofono/plugin.h>
@@ -334,7 +335,7 @@ static int g1_populate(struct ofono_modem *modem)ofono_call_meter_create (modem,"generic_at" , chat);ofono_call_barring_create (modem,"generic_at" , chat);ofono_ssn_create (modem,"generic_at" , chat); -ofono_sms_create (modem,"generic_at" , chat); +ofono_sms_create (modem,"HTC G1" , chat);ofono_phonebook_create (modem,"generic_at" , chat); mw =ofono_message_waiting_create (modem);
@@ -357,6 +358,8 @@ static int g1_init(void) {int err; +g1_sms_init (); + err =ofono_modem_driver_register (&g1_driver);if (err) goto done;
@@ -385,6 +388,8 @@ static void g1_exit(void) {ofono_modem_remove (g1_modem);ofono_modem_driver_unregister (&g1_driver); + +g1_sms_exit (); } OFONO_PLUGIN_DEFINE(g1, "HTC G1 modem driver", VERSION,
plugins/g1sms.c new file +554 -0
554 lines not on this page · raw message
plugins/g1sms.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* +* oFono - Open Source Telephony +* +* Copyright (C) 2008-2009 Intel Corporation. All rights reserved. +* Copyright (C) 2009 Collabora Ltd. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +* +*/ + +#ifndef __G1SMS_H +#define __G1SMS_H + +extern void g1_sms_init (void ); +extern void g1_sms_exit (void ); + +#endif
Signature · 1 line
1.6.3.3
Hi Andres,
Quoted 7 lines
This is based on the atmodem SMS code, with lots of stuff dropped.
The G1's modem advertises support for CNMI mode 2, but attempting to set that actually fails. Instead, we _need_ to use mode 1. Along those lines, CNMA doesn't appear to work properly, so we disable it and use CMTI rather than CMT for PDUs. CDS notifications (for status notifications) are disabled completely.
So as we discussed on IRC, this one should really be rolled up into the generic_at sms driver, since the only change of substance is the cnmi mode selection specific to the g1. We need a driver quirk system to be figured out first though.
Regards,
-Denis