summaryrefslogtreecommitdiff
path: root/tools/hci-tester.c
diff options
context:
space:
mode:
authorTedd Ho Jeong An <tedd.an@intel.com>2018-02-06 13:03:56 -0800
committerMarcel Holtmann <marcel@holtmann.org>2018-02-07 09:37:42 +0100
commit6990e417c427dcdfe27ff3b8d1cea208775d070d (patch)
tree2350fc1a0ff964a76783c9752bb39659b08ae95a /tools/hci-tester.c
parenta62f013cd08d25fd252d7a148d1fb4c462d9d7ac (diff)
downloadbluez-6990e417c427dcdfe27ff3b8d1cea208775d070d.tar.gz
tester: Set event mask for LE Read Local P-256 PK Complete event
LE Read Local P-256 PK command fails because LE Read Local P-256 PK Complete event and LE Meta event are disabled by default. This patch sets event masks for LE Read Local P-256 PK Complete and LE Meta Event to receive the events for 'LE Read Local PK' test and 'LE Generate DHKey' test.
Diffstat (limited to 'tools/hci-tester.c')
-rw-r--r--tools/hci-tester.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/hci-tester.c b/tools/hci-tester.c
index e900789ac..1e9ce4e54 100644
--- a/tools/hci-tester.c
+++ b/tools/hci-tester.c
@@ -460,11 +460,27 @@ static void test_le_read_local_pk_status(const void *data, uint8_t size,
static void test_le_read_local_pk(const void *test_data)
{
struct user_data *user = tester_get_data();
+ struct bt_hci_cmd_set_event_mask sem;
+ struct bt_hci_cmd_le_set_event_mask lsem;
bt_hci_register(user->hci_ut, BT_HCI_EVT_LE_META_EVENT,
test_le_read_local_pk_complete,
(void *)test_data, NULL);
+ memset(sem.mask, 0, 8);
+ sem.mask[1] |= 0x20; /* Command Complete */
+ sem.mask[1] |= 0x40; /* Command Status */
+ sem.mask[7] |= 0x20; /* LE Meta */
+
+ bt_hci_send(user->hci_ut, BT_HCI_CMD_SET_EVENT_MASK,
+ &sem, sizeof(sem), NULL, NULL, NULL);
+
+ memset(lsem.mask, 0, 8);
+ lsem.mask[0] |= 0x80; /* LE Read Local P-256 Public Key Complete */
+
+ bt_hci_send(user->hci_ut, BT_HCI_CMD_LE_SET_EVENT_MASK,
+ &lsem, sizeof(lsem), NULL, NULL, NULL);
+
if (!bt_hci_send(user->hci_ut, BT_HCI_CMD_LE_READ_LOCAL_PK256, NULL,
0, test_le_read_local_pk_status,
NULL, NULL)) {
@@ -517,11 +533,27 @@ static void setup_le_read_local_pk_status(const void *data, uint8_t size,
static void setup_le_generate_dhkey(const void *test_data)
{
struct user_data *user = tester_get_data();
+ struct bt_hci_cmd_set_event_mask sem;
+ struct bt_hci_cmd_le_set_event_mask lsem;
bt_hci_register(user->hci_ut, BT_HCI_EVT_LE_META_EVENT,
setup_le_read_local_pk_complete,
(void *)test_data, NULL);
+ memset(sem.mask, 0, 8);
+ sem.mask[1] |= 0x20; /* Command Complete */
+ sem.mask[1] |= 0x40; /* Command Status */
+ sem.mask[7] |= 0x20; /* LE Meta */
+
+ bt_hci_send(user->hci_ut, BT_HCI_CMD_SET_EVENT_MASK,
+ &sem, sizeof(sem), NULL, NULL, NULL);
+
+ memset(lsem.mask, 0, 8);
+ lsem.mask[0] |= 0x80; /* LE Read Local P-256 Public Key Complete */
+
+ bt_hci_send(user->hci_ut, BT_HCI_CMD_LE_SET_EVENT_MASK,
+ &lsem, sizeof(lsem), NULL, NULL, NULL);
+
if (!bt_hci_send(user->hci_ut, BT_HCI_CMD_LE_READ_LOCAL_PK256, NULL,
0, setup_le_read_local_pk_status,
NULL, NULL)) {