projects
/
profile
/
ivi
/
lemolo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad842cd
)
ofono: try online/powered more than just the mask.
author
Gustavo Sverzut Barbieri
<barbieri@profusion.mobi>
Mon, 17 Sep 2012 18:26:00 +0000
(15:26 -0300)
committer
Gustavo Sverzut Barbieri
<barbieri@profusion.mobi>
Mon, 17 Sep 2012 18:26:00 +0000
(15:26 -0300)
instead of just getting the first, keep looking for an online and
powered modem.
utils/ofono.c
patch
|
blob
|
history
diff --git
a/utils/ofono.c
b/utils/ofono.c
index
1252a73
..
961a847
100644
(file)
--- a/
utils/ofono.c
+++ b/
utils/ofono.c
@@
-816,8
+816,14
@@
static OFono_Modem *_modem_selected_get(void)
}
}
- if (!found_api) {
- DBG("m=%#x, mask=%#x", m->interfaces, modem_api_mask);
+ if ((!found_api) || ((!found_api->online) ||
+ (!found_api->powered))) {
+ DBG("m=%#x, mask=%#x, previous=%s "
+ "(online=%d, powered=%d)",
+ m->interfaces, modem_api_mask,
+ found_api ? found_api->base.path : "",
+ found_api ? found_api->online : 0,
+ found_api ? found_api->powered : 0);
if ((m->interfaces & modem_api_mask) == modem_api_mask)
found_api = m;
}