From 237daac54a53b367c1d01eb80808e0091576ec8b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 16 Nov 2016 11:02:21 +0100 Subject: [PATCH] hci: add commands for dealing with OOB data for classic pairing --- src/hci_cmd.c | 25 ++++++++++++++++++++++++- src/hci_cmd.h | 5 ++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/hci_cmd.c b/src/hci_cmd.c index 0107ac4fb..f85794e49 100644 --- a/src/hci_cmd.c +++ b/src/hci_cmd.c @@ -62,7 +62,7 @@ * D: 8 byte data block * E: Extended Inquiry Result * N: Name up to 248 chars, \0 terminated - * P: 16 byte Pairing code + * P: 16 byte data block. Pairing code, Simple Pairing Hash and Randomizer * A: 31 bytes advertising data * S: Service Record (Data Element Sequence) * Q: 32 byte data block, e.g. for X and Y coordinates of P-256 public key @@ -386,6 +386,15 @@ const hci_cmd_t hci_user_passkey_request_negative_reply = { OPCODE(OGF_LINK_CONTROL, 0x2f), "B" }; +/** + * @param bd_addr + * @param c Simple Pairing Hash C + * @param r Simple Pairing Randomizer R + */ +const hci_cmd_t hci_remote_oob_data_request_reply = { +OPCODE(OGF_LINK_CONTROL, 0x30), "BPP" +}; + /** * @param bd_addr */ @@ -677,6 +686,12 @@ const hci_cmd_t hci_write_simple_pairing_mode = { OPCODE(OGF_CONTROLLER_BASEBAND, 0x56), "1" }; +/** + */ +const hci_cmd_t hci_read_local_oob_data = { +OPCODE(OGF_CONTROLLER_BASEBAND, 0x57), "" +// return status, C, R +}; /** * @param mode (0 = off, 1 = on) @@ -701,6 +716,14 @@ OPCODE(OGF_CONTROLLER_BASEBAND, 0x6d), "11" // return: status }; +/** + */ +const hci_cmd_t hci_read_local_extended_ob_data = { +OPCODE(OGF_CONTROLLER_BASEBAND, 0x7d), "" +// return status, C_192, R_192, R_256, C_256 +}; + + /** * Testing Commands */ diff --git a/src/hci_cmd.h b/src/hci_cmd.h index b4286c5f3..f53b9e241 100644 --- a/src/hci_cmd.h +++ b/src/hci_cmd.h @@ -112,16 +112,19 @@ extern const hci_cmd_t hci_read_buffer_size; extern const hci_cmd_t hci_read_le_host_supported; extern const hci_cmd_t hci_read_link_policy_settings; extern const hci_cmd_t hci_read_link_supervision_timeout; +extern const hci_cmd_t hci_read_local_extended_oob_data; extern const hci_cmd_t hci_read_local_name; -extern const hci_cmd_t hci_read_local_version_information; +extern const hci_cmd_t hci_read_local_oob_data; extern const hci_cmd_t hci_read_local_supported_commands; extern const hci_cmd_t hci_read_local_supported_features; +extern const hci_cmd_t hci_read_local_version_information; extern const hci_cmd_t hci_read_num_broadcast_retransmissions; extern const hci_cmd_t hci_read_remote_supported_features_command; extern const hci_cmd_t hci_read_rssi; extern const hci_cmd_t hci_reject_connection_request; extern const hci_cmd_t hci_remote_name_request; extern const hci_cmd_t hci_remote_name_request_cancel; +extern const hci_cmd_t hci_remote_oob_data_request_reply; extern const hci_cmd_t hci_remote_oob_data_request_negative_reply; extern const hci_cmd_t hci_reset; extern const hci_cmd_t hci_role_discovery;