mirror of git://git.sysmocom.de/ofono
hfp_hf_bluez5: Add a card driver for HFP 1.6
This is just the skeleton of a Handsfree Audio Card for the HF side of HFP 1.6.
This commit is contained in:
parent
ac4e5f0045
commit
759cf25614
|
@ -60,6 +60,8 @@
|
||||||
|
|
||||||
#define HFP_EXT_PROFILE_PATH "/bluetooth/profile/hfp_hf"
|
#define HFP_EXT_PROFILE_PATH "/bluetooth/profile/hfp_hf"
|
||||||
|
|
||||||
|
#define HFP16_HF_DRIVER "hfp16-hf-driver"
|
||||||
|
|
||||||
struct hfp {
|
struct hfp {
|
||||||
struct hfp_slc_info info;
|
struct hfp_slc_info info;
|
||||||
DBusMessage *msg;
|
DBusMessage *msg;
|
||||||
|
@ -310,6 +312,31 @@ static struct ofono_modem_driver hfp_driver = {
|
||||||
.post_sim = hfp_post_sim,
|
.post_sim = hfp_post_sim,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int hfp16_card_probe(struct ofono_handsfree_card *card,
|
||||||
|
unsigned int vendor, void *data)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hfp16_card_remove(struct ofono_handsfree_card *card)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hfp16_card_connect(struct ofono_handsfree_card *card,
|
||||||
|
ofono_handsfree_card_connect_cb_t cb,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct ofono_handsfree_card_driver hfp16_hf_driver = {
|
||||||
|
.name = HFP16_HF_DRIVER,
|
||||||
|
.probe = hfp16_card_probe,
|
||||||
|
.remove = hfp16_card_remove,
|
||||||
|
.connect = hfp16_card_connect,
|
||||||
|
};
|
||||||
|
|
||||||
static ofono_bool_t device_path_compare(struct ofono_modem *modem,
|
static ofono_bool_t device_path_compare(struct ofono_modem *modem,
|
||||||
void *userdata)
|
void *userdata)
|
||||||
{
|
{
|
||||||
|
@ -616,6 +643,13 @@ static int hfp_init(void)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = ofono_handsfree_card_driver_register(&hfp16_hf_driver);
|
||||||
|
if (err < 0) {
|
||||||
|
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
|
||||||
|
BLUEZ_PROFILE_INTERFACE);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
err = ofono_modem_driver_register(&hfp_driver);
|
err = ofono_modem_driver_register(&hfp_driver);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
|
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
|
||||||
|
@ -647,6 +681,9 @@ static void hfp_exit(void)
|
||||||
bt_unregister_profile(conn, HFP_EXT_PROFILE_PATH);
|
bt_unregister_profile(conn, HFP_EXT_PROFILE_PATH);
|
||||||
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
|
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
|
||||||
BLUEZ_PROFILE_INTERFACE);
|
BLUEZ_PROFILE_INTERFACE);
|
||||||
|
|
||||||
|
ofono_handsfree_card_driver_unregister(&hfp16_hf_driver);
|
||||||
|
|
||||||
ofono_modem_driver_unregister(&hfp_driver);
|
ofono_modem_driver_unregister(&hfp_driver);
|
||||||
g_dbus_client_unref(bluez);
|
g_dbus_client_unref(bluez);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue