bluez5: Create backend skeleton for HSP/HFP support using hsphfpd

As hsphfpd is a prototype and its API subject to change, this backend is
disable by default.

This skeleton connects to hsphfpd daemon and list the managed devices.
This commit is contained in:
Frédéric Danis 2020-07-22 17:40:32 +02:00 committed by Wim Taymans
parent 3e7609dcaf
commit 7bad76737e
7 changed files with 688 additions and 0 deletions

View file

@ -75,6 +75,7 @@ struct spa_bt_monitor {
struct spa_bt_backend *backend_hsp_native;
struct spa_bt_backend *backend_ofono;
struct spa_bt_backend *backend_hsphfpd;
};
static inline void add_dict(struct spa_pod_builder *builder, const char *key, const char *val)
@ -1634,6 +1635,9 @@ impl_device_add_listener(void *object, struct spa_hook *listener,
if (this->backend_ofono)
backend_ofono_add_filters(this->backend_ofono);
if (this->backend_hsphfpd)
backend_hsphfpd_add_filters(this->backend_hsphfpd);
spa_hook_list_join(&this->hooks, &save);
return 0;
@ -1687,6 +1691,11 @@ static int impl_clear(struct spa_handle *handle)
monitor->backend_ofono = NULL;
}
if (monitor->backend_hsphfpd) {
backend_hsphfpd_free(monitor->backend_hsphfpd);
monitor->backend_hsphfpd = NULL;
}
return 0;
}
@ -1744,6 +1753,7 @@ impl_init(const struct spa_handle_factory *factory,
this->backend_hsp_native = backend_hsp_native_new(this, this->conn, support, n_support);
this->backend_ofono = backend_ofono_new(this, this->conn, support, n_support);
this->backend_hsphfpd = backend_hsphfpd_new(this, this->conn, support, n_support);
return 0;
}