summaryrefslogtreecommitdiff
path: root/monitor/emulator.h
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-01-04 14:43:15 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-01-05 15:06:40 -0800
commit4a00535fa3b3f8309cf38f53b92e0a4dd7333eee (patch)
tree9ac083fba14b83bdfc27be6380ce1417905da61c /monitor/emulator.h
parentac33d95d2944c089707eadbd2933442ceaeedab1 (diff)
downloadbluez-4a00535fa3b3f8309cf38f53b92e0a4dd7333eee.tar.gz
emulator: Add support for vendor commands
This adds support for vendor commands reserving a single opcode (0xfc10) so it can be extended using subcommands, similar to how MSFT works. The first subcommand (0x00) enables the emulator to generate arbitrary events using the commands parameters: > tools/hcitool cmd 3f 10 00 22 24 d0 d0 d0 d0 d0 d0 ff ff < HCI Command: Vendor (0x3f|0x0010) plen 11 00 22 24 d0 d0 d0 d0 d0 d0 ff ff ."$........ Bluetooth: hci0: Malformed HCI Event: 0x22 > HCI Event: Inquiry Result with R.. (0x22) plen 9 Num responses: 36 Page scan repetition mode: Reserved (0xff) Page period mode: Reserved (0xff) Class: 0xffffd0 Major class: Uncategorized, specific device code not specified Minor class: 0x34 Limited Discoverable Mode invalid service class Clock offset: 0x6368 RSSI: 105 dBm (0x69) > HCI Event: Command Complete (0x0e) plen 4 Vendor (0x3f|0x0010) ncmd 1 Status: Success (0x00)
Diffstat (limited to 'monitor/emulator.h')
-rw-r--r--monitor/emulator.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/monitor/emulator.h b/monitor/emulator.h
new file mode 100644
index 000000000..dc9351e4e
--- /dev/null
+++ b/monitor/emulator.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2011-2014 Intel Corporation
+ * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ */
+
+#define EMU_SUBCMD_TEST_EVENT 0x00
+
+struct emu_cmd_test_event {
+ uint8_t subcmd;
+ uint8_t evt;
+ uint8_t data[];
+} __attribute__((packed));