summaryrefslogtreecommitdiff
path: root/emulator/main.c
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 /emulator/main.c
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 'emulator/main.c')
-rw-r--r--emulator/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/emulator/main.c b/emulator/main.c
index 3c215efbc..bd9831449 100644
--- a/emulator/main.c
+++ b/emulator/main.c
@@ -193,6 +193,7 @@ int main(int argc, char *argv[])
if (debug_enabled)
vhci_set_debug(vhci, vhci_debug, UINT_TO_PTR(i), NULL);
+ vhci_set_emu_opcode(vhci, 0xfc10);
vhci_set_msft_opcode(vhci, 0xfc1e);
}