2021-07-16 19:42:52

by Gix, Brian

[permalink] [raw]
Subject: [PATCH BlueZ v2 1/3] emulator/btdev: Add support HCI_READ_CLOCK command

From: Tedd Ho-Jeong An <[email protected]>

This patch adds support HCI_READ_CLOCK command in btdev.
---
emulator/btdev.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 90b3d9f31..0a5645c5c 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -2296,6 +2296,22 @@ static int cmd_read_rssi(struct btdev *dev, const void *data,
return 0;
}

+static int cmd_read_clock(struct btdev *dev, const void *data,
+ uint8_t len)
+{
+ const struct bt_hci_cmd_read_clock *cmd = data;
+ struct bt_hci_rsp_read_clock rsp;
+
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.status = BT_HCI_ERR_SUCCESS;
+ rsp.handle = le16_to_cpu(cmd->handle);
+ rsp.clock = 0x11223344;
+ rsp.accuracy = 0x5566;
+ cmd_complete(dev, BT_HCI_CMD_READ_CLOCK, &rsp, sizeof(rsp));
+
+ return 0;
+}
+
static int cmd_enable_dut_mode(struct btdev *dev, const void *data,
uint8_t len)
{
@@ -2389,6 +2405,7 @@ static int cmd_enable_dut_mode(struct btdev *dev, const void *data,
NULL), \
CMD(BT_HCI_CMD_READ_COUNTRY_CODE, cmd_read_country_code, NULL), \
CMD(BT_HCI_CMD_READ_RSSI, cmd_read_rssi, NULL), \
+ CMD(BT_HCI_CMD_READ_CLOCK, cmd_read_clock, NULL), \
CMD(BT_HCI_CMD_ENABLE_DUT_MODE, cmd_enable_dut_mode, NULL)

static void set_common_commands_bredr20(struct btdev *btdev)
@@ -2448,6 +2465,7 @@ static void set_common_commands_bredr20(struct btdev *btdev)
btdev->commands[14] |= 0x40; /* Read Local Extended Features */
btdev->commands[15] |= 0x01; /* Read Country Code */
btdev->commands[15] |= 0x20; /* Read RSSI */
+ btdev->commands[15] |= 0x80; /* Read Clock */
btdev->commands[16] |= 0x04; /* Enable Device Under Test Mode */
}

--
2.31.1


2021-07-16 20:38:50

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,v2,1/3] emulator/btdev: Add support HCI_READ_CLOCK command

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=516839

---Test result---

Test Summary:
CheckPatch PASS 0.92 seconds
GitLint PASS 0.37 seconds
Prep - Setup ELL PASS 49.60 seconds
Build - Prep PASS 0.12 seconds
Build - Configure PASS 8.50 seconds
Build - Make PASS 217.53 seconds
Make Check PASS 9.48 seconds
Make Distcheck PASS 259.54 seconds
Build w/ext ELL - Configure PASS 8.56 seconds
Build w/ext ELL - Make PASS 197.84 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth