mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-21 05:33:49 -04:00
spa: bluez: backend-native: Add support for AT+BLDN for PTS tests
This allows to fake Last Dial Number call by calling the first memory. This allows to pass PTS tests HFP/AG/OCL/BV-01-C and HFP/AG/OCL/BV-02-C.
This commit is contained in:
parent
9a48bbaa36
commit
d89d1668dc
1 changed files with 21 additions and 0 deletions
|
|
@ -125,6 +125,7 @@ struct impl {
|
||||||
struct spa_source *ring_timer;
|
struct spa_source *ring_timer;
|
||||||
void *upower;
|
void *upower;
|
||||||
struct spa_bt_telephony *telephony;
|
struct spa_bt_telephony *telephony;
|
||||||
|
bool pts;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct transport_data {
|
struct transport_data {
|
||||||
|
|
@ -1438,6 +1439,15 @@ next_indicator:
|
||||||
rfcomm_send_error(rfcomm, error);
|
rfcomm_send_error(rfcomm, error);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
} else if (spa_strstartswith(buf, "AT+BLDN") && backend->pts) {
|
||||||
|
enum cmee_error error;
|
||||||
|
|
||||||
|
/* For PTS tests HFP/AG/OCL/BV-01-C and HFP/AG/OCL/BV-02-C, fake last dial
|
||||||
|
* number by calling first memory */
|
||||||
|
if (!mm_do_call(backend->modemmanager, ">1", rfcomm, &error)) {
|
||||||
|
rfcomm_send_error(rfcomm, error);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} else if (spa_strstartswith(buf, "AT+CHUP")) {
|
} else if (spa_strstartswith(buf, "AT+CHUP")) {
|
||||||
enum cmee_error error;
|
enum cmee_error error;
|
||||||
|
|
||||||
|
|
@ -4017,6 +4027,16 @@ static void parse_hfp_disable_nrec(struct impl *backend, const struct spa_dict *
|
||||||
backend->hfp_disable_nrec = false;
|
backend->hfp_disable_nrec = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void parse_hfp_pts(struct impl *backend, const struct spa_dict *info)
|
||||||
|
{
|
||||||
|
const char *str;
|
||||||
|
|
||||||
|
if ((str = spa_dict_lookup(info, "bluez5.hfphsp-backend-native-pts")) != NULL)
|
||||||
|
backend->pts = spa_atob(str);
|
||||||
|
else
|
||||||
|
backend->pts = false;
|
||||||
|
}
|
||||||
|
|
||||||
static void parse_hfp_default_volumes(struct impl *backend, const struct spa_dict *info)
|
static void parse_hfp_default_volumes(struct impl *backend, const struct spa_dict *info)
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
@ -4101,6 +4121,7 @@ struct spa_bt_backend *backend_native_new(struct spa_bt_monitor *monitor,
|
||||||
|
|
||||||
parse_hfp_disable_nrec(backend, info);
|
parse_hfp_disable_nrec(backend, info);
|
||||||
parse_hfp_default_volumes(backend, info);
|
parse_hfp_default_volumes(backend, info);
|
||||||
|
parse_hfp_pts(backend, info);
|
||||||
|
|
||||||
#ifdef HAVE_BLUEZ_5_BACKEND_HSP_NATIVE
|
#ifdef HAVE_BLUEZ_5_BACKEND_HSP_NATIVE
|
||||||
if (!dbus_connection_register_object_path(backend->conn,
|
if (!dbus_connection_register_object_path(backend->conn,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue