diff --git a/android/handsfree.c b/android/handsfree.c
index 4103595..2c33c68 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
uint32_t features;
bool indicators_enabled;
struct indicator inds[IND_COUNT];
+ bool hsp;
struct hfp_gw *gw;
} device;
hfp_gw_set_disconnect_handler(device.gw, disconnect_watch, NULL, NULL);
- hfp_gw_register(device.gw, at_cmd_brsf, "+BRSF", NULL, NULL);
- hfp_gw_register(device.gw, at_cmd_cind, "+CIND", NULL, NULL);
- hfp_gw_register(device.gw, at_cmd_cmer, "+CMER", NULL, NULL);
- device_set_state(HAL_EV_HANDSFREE_CONNECTION_STATE_CONNECTED);
+ if (device.hsp) {
+ /* TODO CKPD, VGS, VGM */
+ device_set_state(HAL_EV_HANDSFREE_CONNECTION_STATE_CONNECTED);
+ device_set_state(HAL_EV_HANDSFREE_CONNECTION_STATE_SLC_CONNECTED);
+ } else {
+ hfp_gw_register(device.gw, at_cmd_brsf, "+BRSF", NULL, NULL);
+ hfp_gw_register(device.gw, at_cmd_cind, "+CIND", NULL, NULL);
+ hfp_gw_register(device.gw, at_cmd_cmer, "+CMER", NULL, NULL);
+ device_set_state(HAL_EV_HANDSFREE_CONNECTION_STATE_CONNECTED);
+ }
return;
goto drop;
}
+ device.hsp = GPOINTER_TO_INT(data);
+
return;
drop:
goto fail;
}
+ device.hsp = true;
+
g_io_channel_unref(io);
return;
DBG("");
- hsp_server = bt_io_listen(NULL, confirm_cb, NULL, NULL, &err,
+ hsp_server = bt_io_listen(NULL, confirm_cb, GINT_TO_POINTER(true), NULL,
+ &err,
BT_IO_OPT_SOURCE_BDADDR, &adapter_addr,
BT_IO_OPT_CHANNEL, HSP_AG_CHANNEL,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
if (hfp_server)
return false;
- hfp_server = bt_io_listen(NULL, confirm_cb, NULL, NULL, &err,
+ hfp_server = bt_io_listen(NULL, confirm_cb, GINT_TO_POINTER(false),
+ NULL, &err,
BT_IO_OPT_SOURCE_BDADDR, &adapter_addr,
BT_IO_OPT_CHANNEL, HFP_AG_CHANNEL,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,