linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK Complete event
@ 2018-02-06 21:03 Tedd Ho-Jeong An
  2018-02-06 21:03 ` [PATCH BlueZ 2/2] tester: Enable LE Generate DHKey " Tedd Ho-Jeong An
  2018-02-07  8:38 ` [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK " Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Tedd Ho-Jeong An @ 2018-02-06 21:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Tedd Ho Jeong An

From: Tedd Ho Jeong An <tedd.an@intel.com>

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.
---
 tools/hci-tester.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tools/hci-tester.c b/tools/hci-tester.c
index e900789..1e9ce4e 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)) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH BlueZ 2/2] tester: Enable LE Generate DHKey Complete event
  2018-02-06 21:03 [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK Complete event Tedd Ho-Jeong An
@ 2018-02-06 21:03 ` Tedd Ho-Jeong An
  2018-02-07  8:38 ` [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK " Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Tedd Ho-Jeong An @ 2018-02-06 21:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Tedd Ho Jeong An

From: Tedd Ho Jeong An <tedd.an@intel.com>

This patch adds LE Generate DHKey Complete event for
LE Event Mask list for 'LE Generate DHKey'.
---
 tools/hci-tester.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/hci-tester.c b/tools/hci-tester.c
index 1e9ce4e..7873e7a 100644
--- a/tools/hci-tester.c
+++ b/tools/hci-tester.c
@@ -550,6 +550,7 @@ static void setup_le_generate_dhkey(const void *test_data)
 
 	memset(lsem.mask, 0, 8);
 	lsem.mask[0] |= 0x80;	/* LE Read Local P-256 Public Key Complete */
+	lsem.mask[1] |= 0x01;	/* LE Generate DHKey Complete */
 
 	bt_hci_send(user->hci_ut, BT_HCI_CMD_LE_SET_EVENT_MASK,
 					&lsem, sizeof(lsem), NULL, NULL, NULL);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK Complete event
  2018-02-06 21:03 [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK Complete event Tedd Ho-Jeong An
  2018-02-06 21:03 ` [PATCH BlueZ 2/2] tester: Enable LE Generate DHKey " Tedd Ho-Jeong An
@ 2018-02-07  8:38 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2018-02-07  8:38 UTC (permalink / raw)
  To: Tedd Ho-Jeong An; +Cc: Bluez mailing list, Tedd Ho Jeong An

Hi Tedd,

> 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.
> ---
> tools/hci-tester.c | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)

both patches have been applied.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-07  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-06 21:03 [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK Complete event Tedd Ho-Jeong An
2018-02-06 21:03 ` [PATCH BlueZ 2/2] tester: Enable LE Generate DHKey " Tedd Ho-Jeong An
2018-02-07  8:38 ` [PATCH BlueZ 1/2] tester: Set event mask for LE Read Local P-256 PK " Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).