bluez5: add support for hardware quirk/feature database

Implement hardware quirk/feature database with pattern matching.
This commit is contained in:
Pauli Virtanen 2021-01-24 15:15:27 +02:00
parent 88077a29db
commit b57ae8c2a6
9 changed files with 396 additions and 15 deletions

View file

@ -54,6 +54,8 @@ struct impl {
struct spa_dbus *dbus;
DBusConnection *conn;
const struct spa_bt_quirks *quirks;
unsigned int filters_added:1;
unsigned int msbc_supported:1;
};
@ -769,6 +771,7 @@ static const struct spa_bt_backend_implementation backend_impl = {
struct spa_bt_backend *backend_ofono_new(struct spa_bt_monitor *monitor,
void *dbus_connection,
const struct spa_dict *info,
const struct spa_bt_quirks *quirks,
const struct spa_support *support,
uint32_t n_support)
{
@ -785,11 +788,12 @@ struct spa_bt_backend *backend_ofono_new(struct spa_bt_monitor *monitor,
spa_bt_backend_set_implementation(&backend->this, &backend_impl, backend);
backend->monitor = monitor;
backend->quirks = quirks;
backend->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
backend->dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
backend->main_loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Loop);
backend->conn = dbus_connection;
if (info && (str = spa_dict_lookup(info, "bluez5.msbc-support")))
if (info && (str = spa_dict_lookup(info, "bluez5.enable-msbc")))
backend->msbc_supported = spa_atob(str);
else
backend->msbc_supported = false;