summaryrefslogtreecommitdiffstats
path: root/telephony-binding/telephony-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'telephony-binding/telephony-binding.c')
-rw-r--r--telephony-binding/telephony-binding.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/telephony-binding/telephony-binding.c b/telephony-binding/telephony-binding.c
index e3c6d2f..d58aeab 100644
--- a/telephony-binding/telephony-binding.c
+++ b/telephony-binding/telephony-binding.c
@@ -141,16 +141,26 @@ static int ofono_init(void)
/* Start the main loop thread */
pthread_create(&tid, NULL, main_loop_thread, NULL);
- ofono_manager_init(interface);
- const gchar *modem_path = ofono_manager_get_default_modem_path();
- DEBUG(interface, "modem_path: %s\n", modem_path);
- vcm = ofono_voicecallmanager_init(interface, modem_path,
- incoming_call_cb,
- dialing_call_cb,
- terminated_call_cb);
- if (!vcm) {
- ERROR(interface, "Failed to initialize voice call manager\n");
- ret = -1;
+ ret = ofono_manager_init(interface);
+ if (ret == 0) {
+ const gchar *modem_path = ofono_manager_get_default_modem_path();
+ if (modem_path) {
+ DEBUG(interface, "modem_path: %s\n", modem_path);
+ vcm = ofono_voicecallmanager_init(interface, modem_path,
+ incoming_call_cb,
+ dialing_call_cb,
+ terminated_call_cb);
+ if (!vcm) {
+ ERROR(interface, "[telephony] failed to initialize voice call manager\n");
+ ret = -1;
+ }
+ } else {
+ ERROR(interface, "[telephony] default modem not set\n");
+ ret = -1;
+ }
+ } else {
+ ERROR(interface, "[telephony] failed to initialize ofono manager: " \
+ "HFP device not connected or Bluetooth disabled\n");
}
return ret;