mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-29 21:32:38 +00:00
hci: mark hci_write_local_name as Classic only, hci_le_generate_dhkey depend on HAVE_HCI_CONTROLLER_DHKEY_SUPPORT, reduce HCI Command Buffer size for LE only
This commit is contained in:
parent
bfb465b059
commit
f9f2075cea
@ -3,16 +3,16 @@ hci_le_add_device_to_white_list
|
|||||||
hci_le_connection_update
|
hci_le_connection_update
|
||||||
hci_le_create_connection
|
hci_le_create_connection
|
||||||
hci_le_create_connection_cancel
|
hci_le_create_connection_cancel
|
||||||
hci_le_encrypt
|
hci_le_encrypt 32
|
||||||
hci_le_long_term_key_negative_reply
|
hci_le_long_term_key_negative_reply
|
||||||
hci_le_long_term_key_request_reply
|
hci_le_long_term_key_request_reply 18
|
||||||
hci_le_rand
|
hci_le_rand
|
||||||
hci_le_read_buffer_size
|
hci_le_read_buffer_size
|
||||||
hci_le_read_white_list_size
|
hci_le_read_white_list_size
|
||||||
hci_le_remove_device_from_white_list
|
hci_le_remove_device_from_white_list
|
||||||
hci_le_set_advertise_enable
|
hci_le_set_advertise_enable
|
||||||
hci_le_set_advertising_data
|
hci_le_set_advertising_data
|
||||||
hci_le_set_advertising_parameters
|
hci_le_set_advertising_parameters 16
|
||||||
hci_le_set_random_address
|
hci_le_set_random_address
|
||||||
hci_le_set_scan_enable
|
hci_le_set_scan_enable
|
||||||
hci_le_set_scan_parameters
|
hci_le_set_scan_parameters
|
||||||
@ -27,3 +27,5 @@ hci_read_remote_supported_features_command
|
|||||||
hci_reset
|
hci_reset
|
||||||
hci_set_event_mask
|
hci_set_event_mask
|
||||||
hci_write_le_host_supported
|
hci_write_le_host_supported
|
||||||
|
|
||||||
|
max parameter length: 32
|
||||||
|
16
src/hci.h
16
src/hci.h
@ -69,10 +69,26 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// packet buffer sizes
|
// packet buffer sizes
|
||||||
|
|
||||||
|
// Max HCI Commadn LE payload size:
|
||||||
|
// 64 from LE Generate DHKey command
|
||||||
|
// 32 from LE Encrypt command
|
||||||
|
#if defined(ENABLE_LE_SECURE_CONNECTIONS) && !defined(HAVE_HCI_CONTROLLER_DHKEY_SUPPORT)
|
||||||
|
#define HCI_CMD_PAYLOAD_SIZE_LE 64
|
||||||
|
#else
|
||||||
|
#define HCI_CMD_PAYLOAD_SIZE_LE 32
|
||||||
|
#endif
|
||||||
|
|
||||||
// HCI_ACL_PAYLOAD_SIZE is configurable and defined in config.h
|
// HCI_ACL_PAYLOAD_SIZE is configurable and defined in config.h
|
||||||
// addition byte in even to terminate remote name request with '\0'
|
// addition byte in even to terminate remote name request with '\0'
|
||||||
#define HCI_EVENT_BUFFER_SIZE (HCI_EVENT_HEADER_SIZE + HCI_EVENT_PAYLOAD_SIZE + 1)
|
#define HCI_EVENT_BUFFER_SIZE (HCI_EVENT_HEADER_SIZE + HCI_EVENT_PAYLOAD_SIZE + 1)
|
||||||
|
|
||||||
|
#ifdef ENABLE_CLASSIC
|
||||||
#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE)
|
#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE)
|
||||||
|
#else
|
||||||
|
#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE_LE)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HCI_ACL_BUFFER_SIZE (HCI_ACL_HEADER_SIZE + HCI_ACL_PAYLOAD_SIZE)
|
#define HCI_ACL_BUFFER_SIZE (HCI_ACL_HEADER_SIZE + HCI_ACL_PAYLOAD_SIZE)
|
||||||
|
|
||||||
// size of hci buffers, big enough for command, event, or acl packet without H4 packet type
|
// size of hci buffers, big enough for command, event, or acl packet without H4 packet type
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#include "classic/sdp_util.h"
|
#include "classic/sdp_util.h"
|
||||||
#include "hci.h"
|
#include "hci.h"
|
||||||
#include "hci_cmd.h"
|
#include "hci_cmd.h"
|
||||||
|
#include "btstack_debug.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -578,12 +579,14 @@ const hci_cmd_t hci_delete_stored_link_key = {
|
|||||||
OPCODE(OGF_CONTROLLER_BASEBAND, 0x12), "B1"
|
OPCODE(OGF_CONTROLLER_BASEBAND, 0x12), "B1"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef ENABLE_CLASSIC
|
||||||
/**
|
/**
|
||||||
* @param local_name (UTF-8, Null Terminated, max 248 octets)
|
* @param local_name (UTF-8, Null Terminated, max 248 octets)
|
||||||
*/
|
*/
|
||||||
const hci_cmd_t hci_write_local_name = {
|
const hci_cmd_t hci_write_local_name = {
|
||||||
OPCODE(OGF_CONTROLLER_BASEBAND, 0x13), "N"
|
OPCODE(OGF_CONTROLLER_BASEBAND, 0x13), "N"
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@ -1052,6 +1055,7 @@ OPCODE(OGF_LE_CONTROLLER, 0x25), ""
|
|||||||
// LE Read Local P-256 Public Key Complete is generated on completion
|
// LE Read Local P-256 Public Key Complete is generated on completion
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_HCI_CONTROLLER_DHKEY_SUPPORT
|
||||||
/**
|
/**
|
||||||
* @param end_test_cmd
|
* @param end_test_cmd
|
||||||
*/
|
*/
|
||||||
@ -1059,6 +1063,7 @@ const hci_cmd_t hci_le_generate_dhkey = {
|
|||||||
OPCODE(OGF_LE_CONTROLLER, 0x26), "QQ"
|
OPCODE(OGF_LE_CONTROLLER, 0x26), "QQ"
|
||||||
// LE Generate DHKey Complete is generated on completion
|
// LE Generate DHKey Complete is generated on completion
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user