mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-14 01:27:41 +00:00
only start le scan if not already scanning, only stop le scan if not idle
This commit is contained in:
parent
564fca325a
commit
36af3e18b6
@ -2155,13 +2155,14 @@ void gap_set_local_name(const char * local_name){
|
||||
}
|
||||
|
||||
le_command_status_t le_central_start_scan(){
|
||||
printf("hci_init: scanning state START_SCAN\n");
|
||||
if (hci_stack->le_scanning_state == LE_SCANNING) return BLE_PERIPHERAL_OK;
|
||||
hci_stack->le_scanning_state = LE_START_SCAN;
|
||||
hci_run();
|
||||
return BLE_PERIPHERAL_OK;
|
||||
}
|
||||
|
||||
le_command_status_t le_central_stop_scan(){
|
||||
if ( hci_stack->le_scanning_state == LE_SCAN_IDLE) return BLE_PERIPHERAL_OK;
|
||||
hci_stack->le_scanning_state = LE_STOP_SCAN;
|
||||
hci_run();
|
||||
return BLE_PERIPHERAL_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user