mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 01:13:23 +00:00
gap: set min encryption key size during init, if supported
This commit is contained in:
parent
6d2375e9ce
commit
a391128d2f
@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### Changed
|
||||
- Chipset: use da145xx in folder/file/function names for these SoCs
|
||||
- GAP: set min encryption key size during init, if supported
|
||||
- ATT Server: use uint8_t for status returns
|
||||
- AVDTP: use BLUETOOTH_SERVICE_CLASS_AUDIO_SINK / SOURCE instead of BLUETOOTH_PROTOCOL_AVDTP in SDP queries
|
||||
- libusb, POSIX and Windows ports: use '-' instead of ':' in btstack_BD_ADDR.tlv filename
|
||||
|
13
src/hci.c
13
src/hci.c
@ -150,11 +150,12 @@
|
||||
X( SUPPORTED_HCI_COMMAND_WRITE_SECURE_CONNECTIONS_HOST , 32, 3) \
|
||||
X( SUPPORTED_HCI_COMMAND_READ_LOCAL_OOB_EXTENDED_DATA_COMMAND , 32, 6) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH, 34, 0) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_READ_MAXIMUM_DATA_LENGTH , 35, 3) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_SET_ADDRESS_RESOLUTION_ENABLE , 35, 1) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_READ_MAXIMUM_DATA_LENGTH , 35, 3) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_SET_DEFAULT_PHY , 35, 5) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_SET_EXTENDED_ADVERTISING_ENABLE , 36, 6) \
|
||||
X( SUPPORTED_HCI_COMMAND_LE_READ_BUFFER_SIZE_V2 , 41, 5) \
|
||||
X( SUPPORTED_HCI_COMMAND_SET_MIN_ENCRYPTION_KEY_SIZE , 45, 7) \
|
||||
|
||||
// enumerate supported commands
|
||||
#define X(name, offset, bit) name,
|
||||
@ -1806,6 +1807,16 @@ static void hci_initializing_run(void){
|
||||
break;
|
||||
}
|
||||
|
||||
/* fall through */
|
||||
|
||||
case HCI_INIT_SET_MIN_ENCRYPTION_KEY_SIZE:
|
||||
// skip set min encryption key size
|
||||
if (hci_classic_supported() && hci_command_supported(SUPPORTED_HCI_COMMAND_SET_MIN_ENCRYPTION_KEY_SIZE)) {
|
||||
hci_stack->substate = HCI_INIT_W4_SET_MIN_ENCRYPTION_KEY_SIZE;
|
||||
hci_send_cmd(&hci_set_min_encryption_key_size, hci_stack->gap_required_encyrption_key_size);
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SCO_OVER_HCI
|
||||
/* fall through */
|
||||
|
||||
|
@ -723,6 +723,8 @@ typedef enum hci_init_state{
|
||||
HCI_INIT_W4_WRITE_INQUIRY_MODE,
|
||||
HCI_INIT_WRITE_SECURE_CONNECTIONS_HOST_ENABLE,
|
||||
HCI_INIT_W4_WRITE_SECURE_CONNECTIONS_HOST_ENABLE,
|
||||
HCI_INIT_SET_MIN_ENCRYPTION_KEY_SIZE,
|
||||
HCI_INIT_W4_SET_MIN_ENCRYPTION_KEY_SIZE,
|
||||
|
||||
#ifdef ENABLE_SCO_OVER_HCI
|
||||
// SCO over HCI
|
||||
|
Loading…
x
Reference in New Issue
Block a user