summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2019-05-31 11:36:52 -0500
committerDenis Kenzior <denkenz@gmail.com>2019-05-31 11:58:39 -0500
commitd493c7cc104a476ef941da7382c1e6c89b3c6507 (patch)
treeb7aa82a9b82d18e1337b43c1a40dfd518488d28a /plugins
parent974e04c6716355e7dcf925c6fa86f9a438ef228b (diff)
downloadofono-d493c7cc104a476ef941da7382c1e6c89b3c6507.tar.gz
quectel: Use at_util_open_device
Diffstat (limited to 'plugins')
-rw-r--r--plugins/quectel.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/plugins/quectel.c b/plugins/quectel.c
index ba1aa42d..6ab97027 100644
--- a/plugins/quectel.c
+++ b/plugins/quectel.c
@@ -94,34 +94,7 @@ static void quectel_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, quectel_debug, debug);
-
- return chat;
+ return at_util_open_device(modem, key, quectel_debug, debug, NULL);
}
static void cpin_notify(GAtResult *result, gpointer user_data)