summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2019-05-31 11:31:39 -0500
committerDenis Kenzior <denkenz@gmail.com>2019-05-31 11:58:39 -0500
commit33af81eae532e7e03d2ba61d9e20575f6a0a37fb (patch)
tree5b9b0552f6ce507ccc1da7289945a62338dca934 /plugins
parent3ab93f4a2178becb3d34396519c1017643c2f085 (diff)
downloadofono-33af81eae532e7e03d2ba61d9e20575f6a0a37fb.tar.gz
sierra: Use at_util_open_device
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sierra.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/plugins/sierra.c b/plugins/sierra.c
index 70d0d11b..0cc1f3a7 100644
--- a/plugins/sierra.c
+++ b/plugins/sierra.c
@@ -94,34 +94,7 @@ static void sierra_remove(struct ofono_modem *modem)
static GAtChat *open_device(struct ofono_modem *modem,
const char *key, char *debug)
{
- const char *device;
- GAtSyntax *syntax;
- GIOChannel *channel;
- GAtChat *chat;
-
- device = ofono_modem_get_string(modem, key);
- if (device == NULL)
- return NULL;
-
- DBG("%s %s", key, device);
-
- channel = g_at_tty_open(device, NULL);
- 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, sierra_debug, debug);
-
- return chat;
+ return at_util_open_device(modem, key, sierra_debug, debug, NULL);
}
static void sim_state_cb(gboolean present, gpointer user_data)