diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-10 12:39:43 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:06:45 +0200 |
commit | 87c2c8632e73a5e128c8b47a958e02fb809618c9 (patch) | |
tree | c18585ea544bfdbc73ec679b454036fb36a04cc9 | |
parent | b791e87b23b3cbfdad53edf1129a1428b14c191c (diff) |
port-probe: new method to check if there is an AT port in a list of probes
-rw-r--r-- | src/mm-port-probe.c | 13 | ||||
-rw-r--r-- | src/mm-port-probe.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 7195bc50..656f0434 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -900,6 +900,19 @@ mm_port_probe_is_at (MMPortProbe *self) } gboolean +mm_port_probe_list_has_at_port (GList *list) +{ + GList *l; + + for (l = list; l; l = g_list_next (l)){ + if (mm_port_probe_is_at (MM_PORT_PROBE (l->data))) + return TRUE; + } + + return FALSE; +} + +gboolean mm_port_probe_is_qcdm (MMPortProbe *self) { g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); diff --git a/src/mm-port-probe.h b/src/mm-port-probe.h index 2cb3f7f0..1c5e7455 100644 --- a/src/mm-port-probe.h +++ b/src/mm-port-probe.h @@ -96,4 +96,7 @@ gboolean mm_port_probe_is_qcdm (MMPortProbe *self); const gchar *mm_port_probe_get_vendor (MMPortProbe *self); const gchar *mm_port_probe_get_product (MMPortProbe *self); +/* Additional helpers */ +gboolean mm_port_probe_list_has_at_port (GList *list); + #endif /* MM_PORT_PROBE_H */ |