mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-29 23:24:20 +08:00
tools/mgmt-tester: Add basic SSP test case
This commit is contained in:
parent
8a5967251a
commit
64488fbf77
@ -2199,6 +2199,34 @@ static const struct generic_data pair_device_success_test_2 = {
|
||||
.pin_len = sizeof(pair_device_pin),
|
||||
};
|
||||
|
||||
static uint16_t settings_powered_pairable_ssp[] = { MGMT_OP_SET_PAIRABLE,
|
||||
MGMT_OP_SET_SSP,
|
||||
MGMT_OP_SET_POWERED,
|
||||
0 };
|
||||
|
||||
static const void *client_bdaddr_param_func(uint8_t *len)
|
||||
{
|
||||
struct test_data *data = tester_get_data();
|
||||
static uint8_t bdaddr[6];
|
||||
|
||||
memcpy(bdaddr, hciemu_get_client_bdaddr(data->hciemu), 6);
|
||||
|
||||
*len = sizeof(bdaddr);
|
||||
|
||||
return bdaddr;
|
||||
}
|
||||
|
||||
static const struct generic_data pair_device_success_test_3 = {
|
||||
.setup_settings = settings_powered_pairable_ssp,
|
||||
.enable_client_ssp = true,
|
||||
.send_opcode = MGMT_OP_PAIR_DEVICE,
|
||||
.send_func = pair_device_send_param_func,
|
||||
.expect_status = MGMT_STATUS_SUCCESS,
|
||||
.expect_func = pair_device_expect_param_func,
|
||||
.expect_hci_command = BT_HCI_CMD_USER_CONFIRM_REQUEST_REPLY,
|
||||
.expect_hci_func = client_bdaddr_param_func,
|
||||
};
|
||||
|
||||
static const char unpair_device_param[] = {
|
||||
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00 };
|
||||
static const char unpair_device_rsp[] = {
|
||||
@ -3372,6 +3400,9 @@ int main(int argc, char *argv[])
|
||||
test_bredrle("Pair Device - Sec Mode 3 Success 1",
|
||||
&pair_device_success_test_2,
|
||||
NULL, test_command_generic);
|
||||
test_bredrle("Pair Device - SSP Just-Works Success 1",
|
||||
&pair_device_success_test_3,
|
||||
NULL, test_command_generic);
|
||||
|
||||
test_bredrle("Unpair Device - Not Powered 1",
|
||||
&unpair_device_not_powered_test_1,
|
||||
|
Loading…
Reference in New Issue
Block a user