From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> Simplify PTS testing by asking for pairing consent. --- android/client/if-bt.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/android/client/if-bt.c b/android/client/if-bt.c index 4d6ff83..218e254 100644 --- a/android/client/if-bt.c +++ b/android/client/if-bt.c @@ -266,7 +266,8 @@ static void ssp_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name, __func__, last_remote_addr, bd_name->name, cod, bt_ssp_variant_t2str(pairing_variant), pass_key); - if (pairing_variant == BT_SSP_VARIANT_PASSKEY_CONFIRMATION) { + switch (pairing_variant) { + case BT_SSP_VARIANT_PASSKEY_CONFIRMATION: sprintf(prompt, "Does other device show %d [Y/n] ?", pass_key); ssp_request_addr = *remote_bd_addr; @@ -274,6 +275,19 @@ static void ssp_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name, ssp_request_pask_key = pass_key; terminal_prompt_for(prompt, ssp_request_yes_no_answer); + break; + case BT_SSP_VARIANT_CONSENT: + sprintf(prompt, "Consent pairing [Y/n] ?"); + + ssp_request_addr = *remote_bd_addr; + ssp_request_variant = pairing_variant; + ssp_request_pask_key = 0; + + terminal_prompt_for(prompt, ssp_request_yes_no_answer); + break; + default: + haltest_info("Not automatically handled\n"); + break; } } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html