base-modem: new method to check if the modem got any AT port

Required for the single-at logic in the plugins.
This commit is contained in:
Aleksander Morgado
2012-03-13 18:18:43 +01:00
parent 3eb4220caa
commit 29f23f2a49
2 changed files with 19 additions and 1 deletions

View File

@@ -506,6 +506,23 @@ mm_base_modem_peek_best_at_port (MMBaseModem *self,
return NULL;
}
gboolean
mm_base_modem_has_at_port (MMBaseModem *self)
{
GHashTableIter iter;
gpointer value;
gpointer key;
/* We'll iterate the ht of ports, looking for any port which is AT */
g_hash_table_iter_init (&iter, self->priv->ports);
while (g_hash_table_iter_next (&iter, &key, &value)) {
if (MM_IS_AT_SERIAL_PORT (value))
return TRUE;
}
return FALSE;
}
static void
initialize_ready (MMBaseModem *self,
GAsyncResult *res)