mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-10 06:40:23 +00:00
set le scan parameters from hci_stack
This commit is contained in:
parent
8ebb5506d7
commit
e2602ea29f
@ -1009,6 +1009,7 @@ void hci_state_reset(){
|
||||
hci_stack->adv_addr_type = 0;
|
||||
memset(hci_stack->adv_address, 0, 6);
|
||||
hci_stack->le_scanning_state = LE_SCAN_IDLE;
|
||||
hci_stack->le_scan_type = 0xff;
|
||||
}
|
||||
|
||||
void hci_init(hci_transport_t *transport, void *config, bt_control_t *control, remote_device_db_t const* remote_device_db){
|
||||
@ -1399,6 +1400,13 @@ void hci_run(){
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (hci_stack->le_scan_type != 0xff){
|
||||
// defaults: active scanning, accept all advertisement packets
|
||||
int scan_type = hci_stack->le_scan_type;
|
||||
hci_stack->le_scan_type = 0xff;
|
||||
hci_send_cmd(&hci_le_set_scan_parameters, scan_type, hci_stack->le_scan_interval, hci_stack->le_scan_window, hci_stack->adv_addr_type, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -408,7 +408,13 @@ typedef struct {
|
||||
|
||||
uint8_t adv_addr_type;
|
||||
bd_addr_t adv_address;
|
||||
|
||||
le_scanning_state_t le_scanning_state;
|
||||
|
||||
// buffer for le scan type command - 0xff not set
|
||||
uint8_t le_scan_type;
|
||||
uint16_t le_scan_interval;
|
||||
uint16_t le_scan_window;
|
||||
} hci_stack_t;
|
||||
|
||||
//*************** le client start
|
||||
|
Loading…
x
Reference in New Issue
Block a user