alcatel: Use at_util_open_device

This commit is contained in:
Denis Kenzior 2019-05-31 11:57:38 -05:00
parent 98ec74cf10
commit c1ccae7efc
1 changed files with 1 additions and 28 deletions

View File

@ -91,34 +91,7 @@ static void alcatel_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, alcatel_debug, debug);
return chat;
return at_util_open_device(modem, key, alcatel_debug, debug, NULL);
}
static void sim_state_cb(gboolean present, gpointer user_data)