mirror of git://git.sysmocom.de/ofono
ublox: Use at_util_open_device
This commit is contained in:
parent
f02a967e68
commit
44e6bccf10
|
@ -43,7 +43,6 @@
|
||||||
#include <ofono/voicecall.h>
|
#include <ofono/voicecall.h>
|
||||||
|
|
||||||
#include <drivers/atmodem/vendor.h>
|
#include <drivers/atmodem/vendor.h>
|
||||||
|
|
||||||
#include <drivers/ubloxmodem/ubloxmodem.h>
|
#include <drivers/ubloxmodem/ubloxmodem.h>
|
||||||
|
|
||||||
static const char *uusbconf_prefix[] = { "+UUSBCONF:", NULL };
|
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,
|
static GAtChat *open_device(struct ofono_modem *modem,
|
||||||
const char *key, char *debug)
|
const char *key, char *debug)
|
||||||
{
|
{
|
||||||
const char *device;
|
return at_util_open_device(modem, key, ublox_debug, debug,
|
||||||
GAtSyntax *syntax;
|
NULL);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
|
static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
|
|
Loading…
Reference in New Issue