[PATCH_v4 0/5] Private network request to ConnMan
by Guillaume Zajac
Hi,
Changelog from v3 is:
- Add private-network source/include
- ConnMan plugin is independant from emulator
- Each application that need VPN will pass a callback as argument
when private network is requested. This callback will contain the
private network settings.
Guillaume Zajac (5):
gatppp: Add new contructor to use external fd
private-network: add callback typedef drivers and settings
private-network: add request/release functions and new feature to
Makefile.am
emulator: add request/release private network calls
connman: add plugin in oFono to request request/release private
network
Makefile.am | 10 +-
gatchat/gatppp.c | 33 +++++-
gatchat/gatppp.h | 1 +
gatchat/ppp.h | 2 +-
gatchat/ppp_net.c | 40 ++++---
include/private-network.h | 59 +++++++++
plugins/connman.c | 297 +++++++++++++++++++++++++++++++++++++++++++++
src/emulator.c | 49 ++++++--
src/ofono.h | 6 +
src/private-network.c | 89 ++++++++++++++
10 files changed, 556 insertions(+), 30 deletions(-)
create mode 100644 include/private-network.h
create mode 100644 plugins/connman.c
create mode 100644 src/private-network.c
3 weeks, 1 day
Business
by Daser Jnr.
Hi all
>From a business point of view, can some one tell me what i can do with ofono
Cheers
Daser S.
2 months, 2 weeks
[PATCH 0/8] Sierra Wireless CDMA modem support
by Forest Bond
From: Forest Bond <forest.bond(a)rapidrollout.com>
This series adds support for Sierra Wireless CDMA modems. Tested with
the MC5728V on the Sprint CDMA network.
Forest Bond (8):
sierramodem: Add skeleton for Sierra Wireless modem driver
sierramodem: Add skeleton cdma netreg driver
sierramodem: Add ERI parsing functions
sierramodem: Report network registration status
sierra: Create GPRS context in post_sim function
sierra: Initialize GSM error reporting separately
sierra: Support CDMA modems
udevng: Support single-interface sierra devices
Makefile.am | 8 +
drivers/sierramodem/cdma-netreg.c | 385 +++++++++++++++++++++++++++++++++++++
drivers/sierramodem/eri.c | 282 +++++++++++++++++++++++++++
drivers/sierramodem/eri.h | 23 +++
drivers/sierramodem/sierramodem.c | 50 +++++
drivers/sierramodem/sierramodem.h | 26 +++
plugins/sierra.c | 117 +++++++++---
plugins/udevng.c | 43 ++++-
8 files changed, 900 insertions(+), 34 deletions(-)
create mode 100644 drivers/sierramodem/cdma-netreg.c
create mode 100644 drivers/sierramodem/eri.c
create mode 100644 drivers/sierramodem/eri.h
create mode 100644 drivers/sierramodem/sierramodem.c
create mode 100644 drivers/sierramodem/sierramodem.h
--
Forest Bond
http://www.alittletooquiet.net
http://www.rapidrollout.com
9 years, 2 months
[PATCH 1/2] qmimodem: add uim message types
by Cedric Jehasse
From: Cedric Jehasse <cedric.jehasse(a)softathome.com>
Define message types for verify pin and card status indication.
---
drivers/qmimodem/uim.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/qmimodem/uim.h b/drivers/qmimodem/uim.h
index 8f123e7..73e9c94 100644
--- a/drivers/qmimodem/uim.h
+++ b/drivers/qmimodem/uim.h
@@ -24,10 +24,13 @@
#define QMI_UIM_WRITE_TRANSPARENT 34 /* Write data */
#define QMI_UIM_WRITE_RECORD 35 /* Write a record */
#define QMI_UIM_GET_FILE_ATTRIBUTES 36 /* Get file attributes */
+#define QMI_UIM_VERIFY_PIN 38 /* Verify PIN*/
#define QMI_UIM_EVENT_REGISTRATION 46 /* Register for indications */
#define QMI_UIM_GET_CARD_STATUS 47 /* Get card status */
+#define QMI_UIM_CARD_STATUS_IND 50 /* Card status indication*/
+
/* Register for indications */
#define QMI_UIM_PARAM_EVENT_MASK 0x01 /* uint32 */
--
1.7.9.5
9 years, 3 months
[PATCHv2 1/2] hfpmodem: Retry AT+CLCC request after outgoing callsetup
by Timo Mueller
From: Timo Mueller <timo.mueller(a)bmw-carit.de>
Currently the list of current calls is requested right after an
outgoing callsetup has been reported by the AG device. If the AG
device updates the list after reporting the callsetup the +CLCC
response may not contain the new call and it is not registered
with oFono.
In this case AT+CLCC should be requested again once after a small
delay.
AT sequence that exhibited the failure (AG device was a Nokia N9
placing an outgoing call)
< \r\n+CIEV: 5,2\r\n
> AT+CLCC\r
< \r\nOK\r\n
< \r\n+VGS=7\r\n
< \r\n+VGM=7\r\n
< \r\n+CIEV: 5,3\r\n
< \r\n+CIEV: 4,1\r\n
< \r\n+CIEV: 5,0\r\n
---
v2: Request CLCC immediately and schedule a second request if the
call was not found in the response. Recheck CLCC when callheld=2 was
received after a callsetup=<2 or 3>.
drivers/hfpmodem/voicecall.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index 33dd05e..18ed54a 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -295,6 +295,31 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
vc);
}
+static void clcc_poll_dialing_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct ofono_voicecall *vc = user_data;
+ struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+ GSList *calls, *dialing;
+
+ if (!ok)
+ return;
+
+ calls = at_util_parse_clcc(result);
+ dialing = find_dialing(calls);
+
+ if (dialing == NULL) {
+ if (vd->clcc_source)
+ g_source_remove(vd->clcc_source);
+
+ vd->clcc_source = g_timeout_add(POLL_CLCC_DELAY,
+ poll_clcc, vc);
+ return;
+ }
+
+ clcc_poll_cb(ok, result, user_data);
+}
+
static gboolean poll_clcc(gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
@@ -977,7 +1002,8 @@ static void ciev_callsetup_notify(struct ofono_voicecall *vc,
* from AG: query and create call.
*/
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
- clcc_poll_cb, vc, NULL);
+ clcc_poll_dialing_cb, vc, NULL);
+
break;
case 3:
--
1.7.11.7
9 years, 3 months
[PATCH v0 0/4] Reject SCO connection
by Claudio Takahasi
Remaining patches of "External HFP: Add SCO" patch series.
* Patches left of the last series:
hfp_hf_bluez5: Add rejecting SCO connection
hfp_hf_bluez5: Fix missing fd close
* Major changes:
- splits patch "hfp_hf_bluez5: Add rejecting SCO connection"
- Replaces bdaddr_t by string. Adapter address is now being
stored as modem string
Claudio Takahasi (2):
hfp_hf_bluez5: Add rejecting SCO connection
hfp_hf_bluez5: Fix missing fd close
Vinicius Costa Gomes (2):
hfp_hf_bluez5: Rename 'Address' modem property to 'Remote'
hfp_hf_bluez5: Set the 'Remote' and 'Local' properties
plugins/hfp_hf_bluez5.c | 111 ++++++++++++++++++++++++++++++++++++++----------
1 file changed, 88 insertions(+), 23 deletions(-)
--
1.7.11.7
9 years, 3 months
[PATCH 1/2] bluetooth: Rename HFP AG plugin
by Frédéric Danis
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based HFP AG plugin for some time, we need to
separate HFP AG plugin which is based on BlueZ 4 from the one based on
BlueZ 5.
The hfp_ag.c plugin is renamed to hfp_ag_bluez4. This will make it easy
to add an HFP AG plugin for BlueZ 5.
---
Makefile.am | 4 ++--
plugins/{hfp_ag.c => hfp_ag_bluez4.c} | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
rename plugins/{hfp_ag.c => hfp_ag_bluez4.c} (97%)
diff --git a/Makefile.am b/Makefile.am
index f24cac7..ee6d24c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -421,8 +421,8 @@ builtin_sources += plugins/sap.c plugins/bluez4.h
builtin_modules += hfp_bluez4
builtin_sources += plugins/hfp_hf_bluez4.c plugins/bluez4.h
-builtin_modules += hfp_ag
-builtin_sources += plugins/hfp_ag.c plugins/bluez4.h
+builtin_modules += hfp_ag_bluez4
+builtin_sources += plugins/hfp_ag_bluez4.c plugins/bluez4.h
builtin_modules += dun_gw
builtin_sources += plugins/dun_gw.c plugins/bluez4.h
diff --git a/plugins/hfp_ag.c b/plugins/hfp_ag_bluez4.c
similarity index 97%
rename from plugins/hfp_ag.c
rename to plugins/hfp_ag_bluez4.c
index 12374ad..039b665 100644
--- a/plugins/hfp_ag.c
+++ b/plugins/hfp_ag_bluez4.c
@@ -213,5 +213,6 @@ static void hfp_ag_exit(void)
}
}
-OFONO_PLUGIN_DEFINE(hfp_ag, "Hands-Free Audio Gateway Profile Plugins", VERSION,
- OFONO_PLUGIN_PRIORITY_DEFAULT, hfp_ag_init, hfp_ag_exit)
+OFONO_PLUGIN_DEFINE(hfp_ag_bluez4, "Hands-Free Audio Gateway Profile Plugins",
+ VERSION, OFONO_PLUGIN_PRIORITY_DEFAULT,
+ hfp_ag_init, hfp_ag_exit)
--
1.7.9.5
9 years, 3 months
[PATCH v0 1/2] hfp_hf_bluez5: Fix registering modem on NewConnection
by Claudio Takahasi
HFP modem will be registered when Proxy Added callback gets called
or when Pair is True. This patch removes the support for dynamic modem
registration when a new connection is notified and there isn't a modem
associated with the Bluetooth remote device.
BlueZ behaviour has been changed and a NewConnection is not notified
before the service discovery finishes.
---
plugins/hfp_hf_bluez5.c | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index ff4dbad..d2f3abb 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -270,10 +270,8 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
{
struct hfp *hfp;
struct ofono_modem *modem;
- DBusMessageIter iter;
- GDBusProxy *proxy;
DBusMessageIter entry;
- const char *device, *alias, *address;
+ const char *device;
int fd, err;
DBG("Profile handler NewConnection");
@@ -286,21 +284,6 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
dbus_message_iter_get_basic(&entry, &device);
- proxy = g_hash_table_lookup(devices_proxies, device);
- if (proxy == NULL)
- return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE
- ".Rejected",
- "Unknown Bluetooth device");
-
- g_dbus_proxy_get_property(proxy, "Alias", &iter);
-
- dbus_message_iter_get_basic(&iter, &alias);
-
- if (g_dbus_proxy_get_property(proxy, "Address", &iter) == FALSE)
- goto invalid;
-
- dbus_message_iter_get_basic(&iter, &address);
-
dbus_message_iter_next(&entry);
if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_UNIX_FD)
goto invalid;
@@ -309,12 +292,12 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
if (fd < 0)
goto invalid;
- modem = modem_register(device, address, alias);
+ modem = g_hash_table_lookup(modem_hash, device);
if (modem == NULL) {
close(fd);
return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE
".Rejected",
- "Could not register HFP modem");
+ "Unknown Bluetooth device");
}
err = service_level_connection(modem, fd, HFP_VERSION_LATEST);
--
1.7.11.7
9 years, 3 months
[PATCH] hfp_hf_bluez5: Remove error handling for g_io_channel_unix_new()
by Vinicius Costa Gomes
Apart from g_io_channel_unix_new() not setting errno, it never
returns an NULL pointer on error, because in practice it only
calls g_new().
---
plugins/hfp_hf_bluez5.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 8cac945..ff4dbad 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -137,11 +137,6 @@ static int service_level_connection(struct ofono_modem *modem,
GAtChat *chat;
io = g_io_channel_unix_new(fd);
- if (io == NULL) {
- ofono_error("Service level connection failed: %s (%d)",
- strerror(errno), errno);
- return -EIO;
- }
syntax = g_at_syntax_new_gsm_permissive();
chat = g_at_chat_new(io, syntax);
--
1.8.1.1
9 years, 3 months
[PATCH] Simcom support
by Anthony Viallard
Add SIMCOM support.
I developped this with the SIM5216E chipset.
SMS and GPRS work. I don't add voice part because i don't use it so
can't test it.
Signed-off-by: Anthony Viallard <homer242 at gmail.com>
--- ofono-1.6.orig/Makefile.am 2012-04-20 21:06:29.000000000 +0200
+++ ofono-1.6/Makefile.am 2013-01-21 17:17:48.089627277 +0100
@@ -371,6 +371,9 @@ builtin_sources += plugins/samsung.c
builtin_modules += sim900
builtin_sources += plugins/sim900.c
+builtin_modules += simcom
+builtin_sources += plugins/simcom.c
+
if BLUETOOTH
builtin_modules += bluetooth
builtin_sources += plugins/bluetooth.c plugins/bluetooth.h
--- ofono-1.6.orig/drivers/atmodem/sms.c 2012-04-20 21:06:29.000000000 +0200
+++ ofono-1.6/drivers/atmodem/sms.c 2013-01-21 16:48:44.460627485 +0100
@@ -805,6 +807,7 @@ static gboolean build_cnmi_string(char *
case OFONO_VENDOR_NOVATEL:
case OFONO_VENDOR_HUAWEI:
case OFONO_VENDOR_ZTE:
+ case OFONO_VENDOR_SIMCOM:
/* MSM devices advertise support for mode 2, but return an
* error if we attempt to actually use it. */
mode = "1";
diff -pruN ofono-1.6.orig/drivers/atmodem/sim.c ofono-1.6/drivers/atmodem/sim.c
--- ofono-1.6.orig/drivers/atmodem/sim.c 2013-01-23 11:38:22.959609087 +0100
+++ ofono-1.6/drivers/atmodem/sim.c 2013-01-23 11:57:52.602608948 +0100
@@ -1023,10 +1023,16 @@ static void at_pin_send_cb(gboolean ok,
FALSE, cbd, g_free);
return;
case OFONO_VENDOR_ZTE:
+ case OFONO_VENDOR_SIMCOM:
/*
* On ZTE modems, after pin is entered, SIM state is checked
* by polling CPIN as their modem doesn't provide unsolicited
* notification of SIM readiness.
+ *
+ * On SIMCOM modems, SIM is busy after pin is entered (we've
+ * got an "+CME ERROR: 14" at "AT+CPIN?" request) and ofono
+ * don't catch the "+CPIN: READY" message sent by the modem
+ * when SIM is ready. So, use extra CPIN to check the state.
*/
sd->sim_state_query = at_util_sim_state_query_new(sd->chat,
2, 20, sim_state_cb, cbd,
diff -purN ofono-1.6/drivers/atmodem/network-registration.c ofono-patched/drivers/atmodem/network-registration.c
--- ofono-1.6/drivers/atmodem/network-registration.c 2013-01-18 15:04:03.598659165 +0100
+++ ofono-patched/drivers/atmodem/network-registration.c 2013-01-18 14:54:03.256659236 +0100
@@ -1411,6 +1411,14 @@ static void at_creg_set_cb(gboolean ok,
}
switch (nd->vendor) {
+ case OFONO_VENDOR_SIMCOM:
+ /* Register for CSQ changes */
+ g_at_chat_send(nd->chat, "AT+AUTOCSQ=1,1", none_prefix,
+ NULL, NULL, NULL);
+
+ g_at_chat_register(nd->chat, "+CSQ:",
+ csq_notify, FALSE, netreg, NULL);
+ break;
case OFONO_VENDOR_PHONESIM:
g_at_chat_register(nd->chat, "+CSQ:",
csq_notify, FALSE, netreg, NULL);
@@ -1534,7 +1537,6 @@ static void at_creg_set_cb(gboolean ok,
break;
case OFONO_VENDOR_NOKIA:
case OFONO_VENDOR_SAMSUNG:
- case OFONO_VENDOR_SIMCOM:
/* Signal strength reporting via CIND is not supported */
break;
default:
--- /dev/null 2013-01-16 10:54:41.551089567 +0100
+++ ofono-1.6/plugins/simcom.c 2013-01-23 10:43:05.631609483 +0100
@@ -0,0 +1,308 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2011 Intel Corporation. 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
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <errno.h>
+#include <stdlib.h>
+
+#include <glib.h>
+#include <gatchat.h>
+#include <gattty.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/modem.h>
+#include <ofono/devinfo.h>
+#include <ofono/netreg.h>
+#include <ofono/sim.h>
+#include <ofono/cbs.h>
+#include <ofono/sms.h>
+#include <ofono/ussd.h>
+#include <ofono/gprs.h>
+#include <ofono/gprs-context.h>
+#include <ofono/radio-settings.h>
+#include <ofono/phonebook.h>
+#include <ofono/log.h>
+
+#include <drivers/atmodem/atutil.h>
+#include <drivers/atmodem/vendor.h>
+
+static const char *none_prefix[] = { NULL };
+
+struct simcom_data {
+ GAtChat *modem;
+ GAtChat *data;
+};
+
+/* Callback and helpers functions */
+static void simcom_debug(const char *str, void *user_data)
+{
+ const char *prefix = user_data;
+
+ ofono_info("%s%s", prefix, str);
+}
+
+static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct simcom_data *data = ofono_modem_get_data(modem);
+
+ DBG("");
+
+ if (!ok) {
+ g_at_chat_unref(data->modem);
+ data->modem = NULL;
+
+ g_at_chat_unref(data->data);
+ data->data = NULL;
+
+ ofono_modem_set_powered(modem, FALSE);
+ return;
+ }
+
+ ofono_modem_set_powered(modem, TRUE);
+}
+
+static void cfun_disable(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct simcom_data *data = ofono_modem_get_data(modem);
+
+ DBG("");
+
+ g_at_chat_unref(data->data);
+ data->data = NULL;
+
+ if (ok)
+ ofono_modem_set_powered(modem, FALSE);
+}
+
+static GAtChat *open_device(struct ofono_modem *modem,
+ const char *key,
+ char *debug)
+{
+ const char *device;
+ GIOChannel *channel;
+ GAtSyntax *syntax;
+ GAtChat *chat;
+ /* GHashTable *options; */
+
+ device = ofono_modem_get_string(modem, key);
+ if (device == NULL)
+ return NULL;
+
+ DBG("%s %s", key, device);
+
+ /* options = g_hash_table_new(g_str_hash, g_str_equal); */
+ /* if (options == NULL) */
+ /* return NULL; */
+
+ /* g_hash_table_insert(options, "Baud", "115200"); */
+ /* g_hash_table_insert(options, "Parity", "none"); */
+ /* g_hash_table_insert(options, "StopBits", "1"); */
+ /* g_hash_table_insert(options, "DataBits", "8"); */
+ /* g_hash_table_insert(options, "XonXoff", "off"); */
+ /* g_hash_table_insert(options, "RtsCts", "on"); */
+ /* g_hash_table_insert(options, "Local", "on"); */
+ /* g_hash_table_insert(options, "Read", "on"); */
+
+ channel = g_at_tty_open(device, NULL);
+
+ /* g_hash_table_destroy(options); */
+
+ if (channel == NULL)
+ return NULL;
+
+ syntax = g_at_syntax_new_gsm_permissive();
+ chat = g_at_chat_new(channel, syntax);
+ g_at_syntax_unref(syntax);
+
+ g_io_channel_unref(channel);
+
+ if (chat == NULL)
+ return NULL;
+
+ if (getenv("OFONO_AT_DEBUG"))
+ g_at_chat_set_debug(chat, simcom_debug, debug);
+
+ return chat;
+}
+
+/* Modem interface function */
+static int simcom_probe(struct ofono_modem *modem)
+{
+ struct simcom_data *data;
+
+ DBG("%p", modem);
+
+ data = g_try_new0(struct simcom_data, 1);
+ if (data == NULL)
+ return -ENOMEM;
+
+ ofono_modem_set_data(modem, data);
+
+ return 0;
+}
+
+static void simcom_remove(struct ofono_modem *modem)
+{
+ struct simcom_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_modem_set_data(modem, NULL);
+
+ /* Cleanup after hot-unplug */
+ g_at_chat_unref(data->data);
+
+ g_free(data);
+}
+
+static int simcom_enable(struct ofono_modem *modem)
+{
+ struct simcom_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ data->modem = open_device(modem, "Modem", "Modem: ");
+ if (data->modem == NULL)
+ return -EINVAL;
+
+ data->data = open_device(modem, "Data", "Data: ");
+ if (data->data == NULL) {
+ g_at_chat_unref(data->modem);
+ data->modem = NULL;
+ return -EIO;
+ }
+
+ g_at_chat_set_slave(data->modem, data->data);
+
+ g_at_chat_blacklist_terminator(data->data,
+ G_AT_CHAT_TERMINATOR_NO_CARRIER);
+
+ /* init modem */
+ g_at_chat_send(data->modem, "ATE0 +CMEE=1", NULL, NULL, NULL, NULL);
+ g_at_chat_send(data->data, "ATE0 +CMEE=1", NULL, NULL, NULL, NULL);
+
+ g_at_chat_send(data->data, "AT+CFUN=1", none_prefix,
+ cfun_enable, modem, NULL);
+
+ return -EINPROGRESS;
+}
+
+static int simcom_disable(struct ofono_modem *modem)
+{
+ struct simcom_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ g_at_chat_cancel_all(data->modem);
+ g_at_chat_unregister_all(data->modem);
+
+ g_at_chat_unref(data->modem);
+ data->modem = NULL;
+
+ g_at_chat_cancel_all(data->data);
+ g_at_chat_unregister_all(data->data);
+
+ g_at_chat_send(data->data, "AT+CFUN=4", none_prefix,
+ cfun_disable, modem, NULL);
+
+ return -EINPROGRESS;
+}
+
+static void simcom_pre_sim(struct ofono_modem *modem)
+{
+ struct simcom_data *data = ofono_modem_get_data(modem);
+ struct ofono_sim *sim;
+
+ DBG("%p", modem);
+
+ ofono_devinfo_create(modem, 0, "atmodem", data->data);
+ sim = ofono_sim_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
+ data->data);
+
+ if (sim)
+ ofono_sim_inserted_notify(sim, TRUE);
+}
+
+static void simcom_post_sim(struct ofono_modem *modem)
+{
+ struct simcom_data *data = ofono_modem_get_data(modem);
+ struct ofono_message_waiting *mw;
+ struct ofono_gprs *gprs;
+ struct ofono_gprs_context *gc;
+
+ DBG("%p", modem);
+
+ ofono_phonebook_create(modem, 0, "atmodem", data->data);
+
+ ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
+ data->data);
+
+ /* gprs things */
+ gprs = ofono_gprs_create(modem, 0, "atmodem", data->data);
+ gc = ofono_gprs_context_create(modem, 0, "atmodem", data->modem);
+
+ if(gprs && gc)
+ {
+ ofono_gprs_add_context(gprs, gc);
+ }
+}
+
+static void simcom_post_online(struct ofono_modem *modem)
+{
+ struct simcom_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_netreg_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", data->data);
+ ofono_cbs_create(modem, 0, "atmodem", data->data);
+ ofono_ussd_create(modem, 0, "atmodem", data->data);
+}
+
+static struct ofono_modem_driver simcom_driver = {
+ .name = "simcom",
+ .probe = simcom_probe,
+ .remove = simcom_remove,
+ .enable = simcom_enable,
+ .disable = simcom_disable,
+ .pre_sim = simcom_pre_sim,
+ .post_sim = simcom_post_sim,
+ .post_online = simcom_post_online,
+};
+
+static int simcom_init(void)
+{
+ return ofono_modem_driver_register(&simcom_driver);
+}
+
+static void simcom_exit(void)
+{
+ ofono_modem_driver_unregister(&simcom_driver);
+}
+
+OFONO_PLUGIN_DEFINE(simcom, "SIMCOM modem driver", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT,
+ simcom_init, simcom_exit)
9 years, 3 months