diff options
author | Denis Kenzior <denkenz@gmail.com> | 2019-05-31 11:38:10 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-05-31 11:58:39 -0500 |
commit | a538238ee5bfa9f091c2a92d4615d522fc460364 (patch) | |
tree | 11a74644dc73eb95dd7deb99aa43d2288c7a4215 /plugins/novatel.c | |
parent | d493c7cc104a476ef941da7382c1e6c89b3c6507 (diff) | |
download | ofono-a538238ee5bfa9f091c2a92d4615d522fc460364.tar.gz |
novatel: Use at_util_open_device
Diffstat (limited to 'plugins/novatel.c')
-rw-r--r-- | plugins/novatel.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/plugins/novatel.c b/plugins/novatel.c index a64364d1..c01aa548 100644 --- a/plugins/novatel.c +++ b/plugins/novatel.c @@ -96,32 +96,7 @@ static void novatel_debug(const char *str, void *user_data) static GAtChat *open_device(struct ofono_modem *modem, const char *key, char *debug) { - GAtChat *chat; - GAtSyntax *syntax; - GIOChannel *channel; - const char *device; - - device = ofono_modem_get_string(modem, key); - if (device == NULL) - return NULL; - - 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, novatel_debug, debug); - - return chat; + return at_util_open_device(modem, key, novatel_debug, debug, NULL); } static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data) |