373
374
struct cb_data *cbd = user_data;
374
375
ofono_handsfree_card_connect_cb_t cb = cbd->cb;
376
struct ofono_handsfree_card *card = cbd->user;
377
struct hfp *hfp = ofono_handsfree_card_get_data(card);
375
378
struct ofono_error error;
377
382
decode_at_error(&error, g_at_result_final_response(result));
379
384
cb(&error, cbd->data);
390
395
info->ag_features & HFP_AG_FEATURE_CODEC_NEGOTIATION) {
391
396
struct cb_data *cbd = cb_data_new(cb, data);
393
g_at_chat_send(info->chat, "AT+BCC", NULL, bcc_cb, cbd, g_free);
399
hfp->bcc_id = g_at_chat_send(info->chat, "AT+BCC",
403
411
ofono_handsfree_card_connect_sco(card);
414
static void hfp16_sco_connected_hint(struct ofono_handsfree_card *card)
416
struct hfp *hfp = ofono_handsfree_card_get_data(card);
417
struct hfp_slc_info *info = &hfp->info;
419
ofono_handsfree_card_connect_cb_t cb;
422
* SCO has just been connected, probably initiated by the AG.
423
* If we have any outstanding BCC requests, then lets cancel these
424
* as they're no longer needed
427
if (hfp->bcc_id == 0)
430
cbd = g_at_chat_get_userdata(info->chat, hfp->bcc_id);
435
CALLBACK_WITH_SUCCESS(cb, cbd->data);
437
/* cbd will be freed once cancel is processed */
438
g_at_chat_cancel(info->chat, hfp->bcc_id);
406
442
static struct ofono_handsfree_card_driver hfp16_hf_driver = {
407
.name = HFP16_HF_DRIVER,
408
.probe = hfp16_card_probe,
409
.remove = hfp16_card_remove,
410
.connect = hfp16_card_connect,
443
.name = HFP16_HF_DRIVER,
444
.probe = hfp16_card_probe,
445
.remove = hfp16_card_remove,
446
.connect = hfp16_card_connect,
447
.sco_connected_hint = hfp16_sco_connected_hint,
413
450
static ofono_bool_t device_path_compare(struct ofono_modem *modem,
703
740
dbus_message_iter_get_basic(&iter, &paired);
742
if (paired == FALSE) {
743
modem = ofono_modem_find(device_path_compare, (void *) path);
746
ofono_modem_remove(modem);
747
g_dbus_proxy_set_removed_watch(proxy, NULL, NULL);
748
g_dbus_proxy_set_property_watch(proxy, NULL, NULL);
707
753
if (g_dbus_proxy_get_property(proxy, "UUIDs", &iter) == FALSE)