hci_cmd: add hci_remote_oob_extended_data_request_reply

use 'K' format specifier for 16-byte data in big-endian format, e.g. OOB data or link keys
This commit is contained in:
Matthias Ringwald 2021-02-04 11:16:02 +01:00
parent af380372ab
commit bb75dd7da2
2 changed files with 20 additions and 4 deletions

View File

@ -139,7 +139,7 @@ uint16_t hci_cmd_create_from_template(uint8_t *hci_cmd_buffer, const hci_cmd_t *
pos += 248;
break;
}
case 'P': // 16 byte PIN code or link key
case 'P': // 16 byte PIN code or link key in little endian
ptr = va_arg(argptr, uint8_t *);
(void)memcpy(&hci_cmd_buffer[pos], ptr, 16);
pos += 16;
@ -167,6 +167,11 @@ uint16_t hci_cmd_create_from_template(uint8_t *hci_cmd_buffer, const hci_cmd_t *
pos += 32;
break;
#endif
case 'K': // 16 byte OOB Data or Link Key in big endian
ptr = va_arg(argptr, uint8_t *);
reverse_bytes(ptr, &hci_cmd_buffer[pos], 16);
pos += 16;
break;
default:
break;
}
@ -409,7 +414,7 @@ const hci_cmd_t hci_user_passkey_request_negative_reply = {
* @param r Simple Pairing Randomizer R
*/
const hci_cmd_t hci_remote_oob_data_request_reply = {
HCI_OPCODE_HCI_REMOTE_OOB_DATA_REQUEST_REPLY, "BPP"
HCI_OPCODE_HCI_REMOTE_OOB_DATA_REQUEST_REPLY, "BKK"
};
/**
@ -503,6 +508,17 @@ const hci_cmd_t hci_enhanced_accept_synchronous_connection = {
HCI_OPCODE_HCI_ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION, "B4412212222441221222211111111221"
};
/**
* @param bd_addr
* @param c_192 Simple Pairing Hash C derived from P-192 public key
* @param r_192 Simple Pairing Randomizer derived from P-192 public key
* @param c_256 Simple Pairing Hash C derived from P-256 public key
* @param r_256 Simple Pairing Randomizer derived from P-256 public key
*/
const hci_cmd_t hci_remote_oob_extended_data_request_reply = {
HCI_OPCODE_HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY, "BKKKK"
};
/**
* Link Policy Commands
*/
@ -852,7 +868,7 @@ const hci_cmd_t hci_write_secure_connections_host_support = {
/**
*/
const hci_cmd_t hci_read_local_extended_ob_data = {
const hci_cmd_t hci_read_local_extended_oob_data = {
HCI_OPCODE_HCI_READ_LOCAL_EXTENDED_OB_DATA, ""
// return status, C_192, R_192, R_256, C_256
};

View File

@ -119,6 +119,7 @@ typedef enum {
HCI_OPCODE_HCI_IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = HCI_OPCODE (OGF_LINK_CONTROL, 0x34),
HCI_OPCODE_HCI_ENHANCED_SETUP_SYNCHRONOUS_CONNECTION = HCI_OPCODE (OGF_LINK_CONTROL, 0x3d),
HCI_OPCODE_HCI_ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION = HCI_OPCODE (OGF_LINK_CONTROL, 0x3e),
HCI_OPCODE_HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY = HCI_OPCODE (OGF_LINK_CONTROL, 0x45),
HCI_OPCODE_HCI_SNIFF_MODE = HCI_OPCODE (OGF_LINK_POLICY, 0x03),
HCI_OPCODE_HCI_EXIT_SNIFF_MODE = HCI_OPCODE (OGF_LINK_POLICY, 0x04),
HCI_OPCODE_HCI_QOS_SETUP = HCI_OPCODE (OGF_LINK_POLICY, 0x07),
@ -264,7 +265,6 @@ extern const hci_cmd_t hci_read_inquiry_scan_activity;
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_ob_data;
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_page_timeout;