api,dbus: rename AllowedBands' to just Bands'
ModemManager will load:
1) The list of supported bands. Note that this doesn't mean that any possible
combination of bands is supported, as modems may support only specific
combinations, but at least gives a rough idea of what the modem is capable
of handling.
2) The list of CURRENT bands. There is no such "Allowed" bands, as we do with
modes, modems will have a specific set of bands being currently used, which
will be reported in the `Bands' property.
If the modem allows modifying the list of bands to use, this can be done with
the `SetBands()' method. If the modem doesn't support using a specific
combination of bands, this method will report an error.
This commit is contained in:
+21
-21
@@ -172,7 +172,7 @@ typedef enum {
|
||||
CONNECTION_STEP_UNLOCK_CHECK,
|
||||
CONNECTION_STEP_ENABLE,
|
||||
CONNECTION_STEP_ALLOWED_MODES,
|
||||
CONNECTION_STEP_ALLOWED_BANDS,
|
||||
CONNECTION_STEP_BANDS,
|
||||
CONNECTION_STEP_REGISTER,
|
||||
CONNECTION_STEP_BEARER,
|
||||
CONNECTION_STEP_CONNECT,
|
||||
@@ -286,14 +286,14 @@ set_allowed_modes_ready (MMBaseModem *self,
|
||||
}
|
||||
|
||||
static void
|
||||
set_allowed_bands_ready (MMBaseModem *self,
|
||||
GAsyncResult *res,
|
||||
ConnectionContext *ctx)
|
||||
set_bands_ready (MMBaseModem *self,
|
||||
GAsyncResult *res,
|
||||
ConnectionContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_iface_modem_set_allowed_bands_finish (MM_IFACE_MODEM (self), res, &error)) {
|
||||
/* If setting allowed bands is unsupported, keep on */
|
||||
if (!mm_iface_modem_set_bands_finish (MM_IFACE_MODEM (self), res, &error)) {
|
||||
/* If setting bands is unsupported, keep on */
|
||||
if (!g_error_matches (error,
|
||||
MM_CORE_ERROR,
|
||||
MM_CORE_ERROR_UNSUPPORTED)) {
|
||||
@@ -303,7 +303,7 @@ set_allowed_bands_ready (MMBaseModem *self,
|
||||
}
|
||||
}
|
||||
|
||||
/* Allowed bands set... almost there! */
|
||||
/* Bands set... almost there! */
|
||||
ctx->step++;
|
||||
connection_step (ctx);
|
||||
}
|
||||
@@ -448,27 +448,27 @@ connection_step (ConnectionContext *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
case CONNECTION_STEP_ALLOWED_BANDS: {
|
||||
case CONNECTION_STEP_BANDS: {
|
||||
GArray *array;
|
||||
const MMModemBand *allowed_bands = NULL;
|
||||
guint n_allowed_bands = 0;
|
||||
const MMModemBand *bands = NULL;
|
||||
guint n_bands = 0;
|
||||
guint i;
|
||||
|
||||
mm_info ("Simple connect state (%d/%d): Allowed bands",
|
||||
mm_info ("Simple connect state (%d/%d): Bands",
|
||||
ctx->step, CONNECTION_STEP_LAST);
|
||||
|
||||
mm_common_connect_properties_get_allowed_bands (ctx->properties,
|
||||
&allowed_bands,
|
||||
&n_allowed_bands);
|
||||
mm_common_connect_properties_get_bands (ctx->properties,
|
||||
&bands,
|
||||
&n_bands);
|
||||
|
||||
array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_allowed_bands);
|
||||
for (i = 0; i < n_allowed_bands; i++)
|
||||
g_array_insert_val (array, i, allowed_bands[i]);
|
||||
array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_bands);
|
||||
for (i = 0; i < n_bands; i++)
|
||||
g_array_insert_val (array, i, bands[i]);
|
||||
|
||||
mm_iface_modem_set_allowed_bands (MM_IFACE_MODEM (ctx->self),
|
||||
array,
|
||||
(GAsyncReadyCallback)set_allowed_bands_ready,
|
||||
ctx);
|
||||
mm_iface_modem_set_bands (MM_IFACE_MODEM (ctx->self),
|
||||
array,
|
||||
(GAsyncReadyCallback)set_bands_ready,
|
||||
ctx);
|
||||
g_array_unref (array);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user