diff options
author | Denis Kenzior <denkenz@gmail.com> | 2019-05-31 11:21:42 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-05-31 11:58:39 -0500 |
commit | 44e6bccf108eaf22fe797f33ac2f3195399ed4f3 (patch) | |
tree | 4765e37307aae0b97f379a170b75dc720f1568ff /plugins/ublox.c | |
parent | f02a967e68a22bf71303425e60fa092d2f2bbeca (diff) | |
download | ofono-44e6bccf108eaf22fe797f33ac2f3195399ed4f3.tar.gz |
ublox: Use at_util_open_device
Diffstat (limited to 'plugins/ublox.c')
-rw-r--r-- | plugins/ublox.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/plugins/ublox.c b/plugins/ublox.c index 1ca0030a..ff08a6a1 100644 --- a/plugins/ublox.c +++ b/plugins/ublox.c @@ -43,7 +43,6 @@ #include <ofono/voicecall.h> #include <drivers/atmodem/vendor.h> - #include <drivers/ubloxmodem/ubloxmodem.h> static const char *uusbconf_prefix[] = { "+UUSBCONF:", NULL }; @@ -99,34 +98,8 @@ static void ublox_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, ublox_debug, debug); - - return chat; + return at_util_open_device(modem, key, ublox_debug, debug, + NULL); } static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data) |