diff --git a/emulator/btdev.c b/emulator/btdev.c
index ac38eaa..900f62f 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
btdev->commands[2] |= 0x10; /* Cancel Remote Name Request */
btdev->commands[2] |= 0x20; /* Read Remote Supported Features */
btdev->commands[2] |= 0x40; /* Read Remote Extended Features */
+ btdev->commands[3] |= 0x01; /* Read Clock Offset */
btdev->commands[5] |= 0x08; /* Read Default Link Policy */
btdev->commands[5] |= 0x10; /* Write Default Link Policy */
btdev->commands[6] |= 0x01; /* Set Event Filter */
&rvc, sizeof(rvc));
}
+static void remote_clock_offset_complete(struct btdev *btdev, uint16_t handle)
+{
+ struct bt_hci_evt_clock_offset_complete coc;
+
+ if (btdev->conn) {
+ coc.status = BT_HCI_ERR_SUCCESS;
+ coc.handle = cpu_to_le16(handle);
+ coc.clock_offset = 0;
+ } else {
+ coc.status = BT_HCI_ERR_UNKNOWN_CONN_ID;
+ coc.handle = cpu_to_le16(handle);
+ coc.clock_offset = 0;
+ }
+
+ send_event(btdev, BT_HCI_EVT_CLOCK_OFFSET_COMPLETE,
+ &coc, sizeof(coc));
+}
+
static void io_cap_req_reply_complete(struct btdev *btdev,
const uint8_t *bdaddr,
uint8_t capability, uint8_t oob_data,
cmd_status(btdev, BT_HCI_ERR_SUCCESS, opcode);
break;
+ case BT_HCI_CMD_READ_CLOCK_OFFSET:
+ if (btdev->type == BTDEV_TYPE_LE)
+ goto unsupported;
+ cmd_status(btdev, BT_HCI_ERR_SUCCESS, opcode);
+ break;
+
case BT_HCI_CMD_READ_DEFAULT_LINK_POLICY:
if (btdev->type == BTDEV_TYPE_LE)
goto unsupported;
const struct bt_hci_cmd_read_remote_features *rrf;
const struct bt_hci_cmd_read_remote_ext_features *rref;
const struct bt_hci_cmd_read_remote_version *rrv;
+ const struct bt_hci_cmd_read_clock_offset *rco;
const struct bt_hci_cmd_le_create_conn *lecc;
switch (opcode) {
remote_version_complete(btdev, le16_to_cpu(rrv->handle));
break;
+ case BT_HCI_CMD_READ_CLOCK_OFFSET:
+ if (btdev->type == BTDEV_TYPE_LE)
+ return;
+ rco = data;
+ remote_clock_offset_complete(btdev, le16_to_cpu(rco->handle));
+ break;
+
case BT_HCI_CMD_LE_CREATE_CONN:
if (btdev->type == BTDEV_TYPE_BREDR)
return;