ublox: allow creating u-blox bearers if MM_UBLOX_USB_PROFILE_UNKNOWN

The TOBY-L4 doesn't support querying the current USB profile in use
via the AT+UUSBCONF command, so the loaded profile will always be set
as MM_UBLOX_USB_PROFILE_UNKNOWN.

In this case, we will anyway allow creating a u-blox specific bearer,
as long as a network interface has also been found in the modem.
This commit is contained in:
Aleksander Morgado
2017-08-05 13:09:33 +02:00
parent 3f9417be43
commit 3dc3b52e77
2 changed files with 2 additions and 4 deletions

View File

@@ -707,7 +707,6 @@ mm_broadband_bearer_ublox_new (MMBroadbandModem *modem,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
g_assert (profile == MM_UBLOX_USB_PROFILE_ECM || profile == MM_UBLOX_USB_PROFILE_RNDIS);
g_assert (mode == MM_UBLOX_NETWORKING_MODE_ROUTER || mode == MM_UBLOX_NETWORKING_MODE_BRIDGE); g_assert (mode == MM_UBLOX_NETWORKING_MODE_ROUTER || mode == MM_UBLOX_NETWORKING_MODE_BRIDGE);
g_async_initable_new_async ( g_async_initable_new_async (

View File

@@ -840,9 +840,8 @@ create_bearer_step (GTask *task)
case CREATE_BEARER_STEP_CREATE_BEARER: case CREATE_BEARER_STEP_CREATE_BEARER:
/* If we have a net interface, we'll create a u-blox bearer, unless for /* If we have a net interface, we'll create a u-blox bearer, unless for
* any reason we have the back-compatible profile selected, or if we don't * any reason we have the back-compatible profile selected. */
* know the mode to use. */ if ((ctx->self->priv->profile != MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE) &&
if ((ctx->self->priv->profile == MM_UBLOX_USB_PROFILE_ECM || ctx->self->priv->profile == MM_UBLOX_USB_PROFILE_RNDIS) &&
(ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_BRIDGE || ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_ROUTER) && (ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_BRIDGE || ctx->self->priv->mode == MM_UBLOX_NETWORKING_MODE_ROUTER) &&
mm_base_modem_peek_best_data_port (MM_BASE_MODEM (ctx->self), MM_PORT_TYPE_NET)) { mm_base_modem_peek_best_data_port (MM_BASE_MODEM (ctx->self), MM_PORT_TYPE_NET)) {
mm_dbg ("u-blox: creating u-blox broadband bearer (%s profile, %s mode)...", mm_dbg ("u-blox: creating u-blox broadband bearer (%s profile, %s mode)...",