mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-21 21:41:13 +00:00
hci: fix gap_set_connection_parameter_range and gap_set_connection_parameters (don't reset values on HCI Reset)
This commit is contained in:
parent
d26a07e3ca
commit
831711da1f
34
src/hci.c
34
src/hci.c
@ -2364,23 +2364,7 @@ static void hci_state_reset(void){
|
||||
hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
|
||||
hci_stack->le_whitelist = 0;
|
||||
hci_stack->le_whitelist_capacity = 0;
|
||||
|
||||
// connection parameter to use for outgoing connections
|
||||
hci_stack->le_connection_interval_min = 0x0008; // 10 ms
|
||||
hci_stack->le_connection_interval_max = 0x0018; // 30 ms
|
||||
hci_stack->le_connection_latency = 4; // 4
|
||||
hci_stack->le_supervision_timeout = 0x0048; // 720 ms
|
||||
hci_stack->le_minimum_ce_length = 2; // 1.25 ms
|
||||
hci_stack->le_maximum_ce_length = 0x0030; // 30 ms
|
||||
#endif
|
||||
|
||||
// connection parameter range used to answer connection parameter update requests in l2cap
|
||||
hci_stack->le_connection_parameter_range.le_conn_interval_min = 6;
|
||||
hci_stack->le_connection_parameter_range.le_conn_interval_max = 3200;
|
||||
hci_stack->le_connection_parameter_range.le_conn_latency_min = 0;
|
||||
hci_stack->le_connection_parameter_range.le_conn_latency_max = 500;
|
||||
hci_stack->le_connection_parameter_range.le_supervision_timeout_min = 10;
|
||||
hci_stack->le_connection_parameter_range.le_supervision_timeout_max = 3200;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_CLASSIC
|
||||
@ -2444,6 +2428,24 @@ void hci_init(const hci_transport_t *transport, const void *config){
|
||||
// voice setting - signed 16 bit pcm data with CVSD over the air
|
||||
hci_stack->sco_voice_setting = 0x60;
|
||||
|
||||
#ifdef ENABLE_LE_CENTRAL
|
||||
// connection parameter to use for outgoing connections
|
||||
hci_stack->le_connection_interval_min = 0x0008; // 10 ms
|
||||
hci_stack->le_connection_interval_max = 0x0018; // 30 ms
|
||||
hci_stack->le_connection_latency = 4; // 4
|
||||
hci_stack->le_supervision_timeout = 0x0048; // 720 ms
|
||||
hci_stack->le_minimum_ce_length = 2; // 1.25 ms
|
||||
hci_stack->le_maximum_ce_length = 0x0030; // 30 ms
|
||||
#endif
|
||||
|
||||
// connection parameter range used to answer connection parameter update requests in l2cap
|
||||
hci_stack->le_connection_parameter_range.le_conn_interval_min = 6;
|
||||
hci_stack->le_connection_parameter_range.le_conn_interval_max = 3200;
|
||||
hci_stack->le_connection_parameter_range.le_conn_latency_min = 0;
|
||||
hci_stack->le_connection_parameter_range.le_conn_latency_max = 500;
|
||||
hci_stack->le_connection_parameter_range.le_supervision_timeout_min = 10;
|
||||
hci_stack->le_connection_parameter_range.le_supervision_timeout_max = 3200;
|
||||
|
||||
hci_state_reset();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user