modem-helpers: port supported modes filtering to use object logging
This commit is contained in:
@@ -1019,7 +1019,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -850,7 +850,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ load_supported_modes_ready (MMIfaceModem *self,
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
combinations = mm_telit_build_modes_list();
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -1241,7 +1241,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
combinations = mm_telit_build_modes_list();
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ load_supported_modes_finish (MMIfaceModem *self,
|
||||
if (!(combinations = mm_ublox_parse_urat_test_response (response, error)))
|
||||
return FALSE;
|
||||
|
||||
if (!(combinations = mm_ublox_filter_supported_modes (mm_iface_modem_get_model (self), combinations, error)))
|
||||
if (!(combinations = mm_ublox_filter_supported_modes (mm_iface_modem_get_model (self), combinations, self, error)))
|
||||
return FALSE;
|
||||
|
||||
/* Decide and store which combination to apply when ANY requested */
|
||||
|
||||
@@ -980,6 +980,7 @@ supported_modes_per_model (const gchar *model)
|
||||
GArray *
|
||||
mm_ublox_filter_supported_modes (const gchar *model,
|
||||
GArray *combinations,
|
||||
gpointer logger,
|
||||
GError **error)
|
||||
{
|
||||
MMModemModeCombination mode;
|
||||
@@ -1002,7 +1003,7 @@ mm_ublox_filter_supported_modes (const gchar *model,
|
||||
|
||||
all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1);
|
||||
g_array_append_val (all, mode);
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, logger);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ gboolean mm_ublox_get_support_config (const gchar *model,
|
||||
|
||||
GArray *mm_ublox_filter_supported_modes (const gchar *model,
|
||||
GArray *combinations,
|
||||
gpointer logger,
|
||||
GError **error);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -294,7 +294,7 @@ compare_combinations (const gchar *response,
|
||||
g_assert_no_error (error);
|
||||
g_assert (combinations);
|
||||
|
||||
combinations = mm_ublox_filter_supported_modes (model, combinations, &error);
|
||||
combinations = mm_ublox_filter_supported_modes (model, combinations, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (combinations);
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ supported_ms_classes_query_ready (MMBaseModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
g_array_append_val (combinations, mode);
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ static const MMModemMode xmm_modes[] = {
|
||||
|
||||
gboolean
|
||||
mm_xmm_parse_xact_test_response (const gchar *response,
|
||||
gpointer logger,
|
||||
GArray **modes_out,
|
||||
GArray **bands_out,
|
||||
GError **error)
|
||||
@@ -318,7 +319,7 @@ mm_xmm_parse_xact_test_response (const gchar *response,
|
||||
all_modes = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1);
|
||||
g_array_append_val (all_modes, all);
|
||||
|
||||
filtered = mm_filter_supported_modes (all_modes, modes);
|
||||
filtered = mm_filter_supported_modes (all_modes, modes, logger);
|
||||
if (!filtered || filtered->len == 0) {
|
||||
inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||
"Empty supported mode list after frequency band filtering");
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
/* AT+XACT=? response parser */
|
||||
gboolean mm_xmm_parse_xact_test_response (const gchar *response,
|
||||
gpointer logger,
|
||||
GArray **modes_out,
|
||||
GArray **bands_out,
|
||||
GError **error);
|
||||
|
||||
@@ -154,6 +154,7 @@ xact_test_ready (MMBaseModem *self,
|
||||
response = mm_base_modem_at_command_finish (self, res, &error);
|
||||
if (!response ||
|
||||
!mm_xmm_parse_xact_test_response (response,
|
||||
self,
|
||||
&priv->supported_modes,
|
||||
&priv->supported_bands,
|
||||
&error))
|
||||
|
||||
@@ -45,7 +45,7 @@ validate_xact_test_response (const gchar *response,
|
||||
gboolean ret;
|
||||
guint i;
|
||||
|
||||
ret = mm_xmm_parse_xact_test_response (response, &modes, &bands, &error);
|
||||
ret = mm_xmm_parse_xact_test_response (response, NULL, &modes, &bands, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret);
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ parent_load_supported_modes_ready (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
/* Filter out those unsupported modes */
|
||||
filtered = mm_filter_supported_modes (all, combinations);
|
||||
filtered = mm_filter_supported_modes (all, combinations, self);
|
||||
g_array_unref (all);
|
||||
g_array_unref (combinations);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user