summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2019-05-31 11:46:18 -0500
committerDenis Kenzior <denkenz@gmail.com>2019-05-31 11:58:39 -0500
commit2e544e67459ae3c388cca947c6f569abc761d1c8 (patch)
tree742eb3ac7beace5786a84deceade36d65e162226 /plugins
parent1ff6e83db039c4a92d67d5dd4a3a9715e41c6b5f (diff)
downloadofono-2e544e67459ae3c388cca947c6f569abc761d1c8.tar.gz
linktop: Use at_util_open_device
Diffstat (limited to 'plugins')
-rw-r--r--plugins/linktop.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/plugins/linktop.c b/plugins/linktop.c
index bb0d7b8e..2b8acf76 100644
--- a/plugins/linktop.c
+++ b/plugins/linktop.c
@@ -91,34 +91,7 @@ static void linktop_debug(const char *str, void *user_data)
static GAtChat *open_device(struct ofono_modem *modem,
const char *key, char *debug)
{
- const char *device;
- GIOChannel *channel;
- GAtSyntax *syntax;
- 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, linktop_debug, debug);
-
- return chat;
+ return at_util_open_device(modem, key, linktop_debug, debug, NULL);
}
static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)