diff options
Diffstat (limited to 'plugins/mbm.c')
-rw-r--r-- | plugins/mbm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/mbm.c b/plugins/mbm.c index ce27d47f..40568f5e 100644 --- a/plugins/mbm.c +++ b/plugins/mbm.c @@ -29,6 +29,7 @@ #include <glib.h> #include <gatchat.h> +#include <gattty.h> #define OFONO_API_SUBJECT_TO_CHANGE #include <ofono/plugin.h> @@ -87,6 +88,7 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data) static int mbm_enable(struct ofono_modem *modem) { struct mbm_data *data = ofono_modem_get_data(modem); + GIOChannel *channel; GAtSyntax *syntax; const char *device; @@ -99,9 +101,14 @@ static int mbm_enable(struct ofono_modem *modem) return -EINVAL; } + channel = g_at_tty_open(device, NULL); + if (!channel) + return -EIO; + syntax = g_at_syntax_new_gsmv1(); - data->chat = g_at_chat_new_from_tty(device, syntax); + data->chat = g_at_chat_new(channel, syntax); g_at_syntax_unref(syntax); + g_io_channel_unref(channel); if (!data->chat) return -EIO; |