mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-17 11:42:34 +00:00
don't send write scan enable for ble only chips
This commit is contained in:
parent
f5d8d141f8
commit
92368cd384
27
src/hci.c
27
src/hci.c
@ -1121,7 +1121,7 @@ void hci_run(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// send scan enable
|
// send scan enable
|
||||||
if (hci_stack.state == HCI_STATE_WORKING && hci_stack.new_scan_enable_value != 0xff){
|
if (hci_stack.state == HCI_STATE_WORKING && hci_stack.new_scan_enable_value != 0xff && hci_classic_supported()){
|
||||||
hci_send_cmd(&hci_write_scan_enable, hci_stack.new_scan_enable_value);
|
hci_send_cmd(&hci_write_scan_enable, hci_stack.new_scan_enable_value);
|
||||||
hci_stack.new_scan_enable_value = 0xff;
|
hci_stack.new_scan_enable_value = 0xff;
|
||||||
return;
|
return;
|
||||||
@ -1322,18 +1322,19 @@ void hci_run(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable page and inquiry scan
|
if (hci_classic_supported()){
|
||||||
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
// disable page and inquiry scan
|
||||||
|
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
|
||||||
log_info("HCI_STATE_HALTING, disabling inq cans\n");
|
|
||||||
hci_send_cmd(&hci_write_scan_enable, hci_stack.connectable << 1); // drop inquiry scan but keep page scan
|
log_info("HCI_STATE_HALTING, disabling inq scans\n");
|
||||||
|
hci_send_cmd(&hci_write_scan_enable, hci_stack.connectable << 1); // drop inquiry scan but keep page scan
|
||||||
// continue in next sub state
|
|
||||||
hci_stack.substate++;
|
// continue in next sub state
|
||||||
break;
|
hci_stack.substate++;
|
||||||
case 1:
|
break;
|
||||||
// wait for command complete "hci_write_scan_enable" in event_handler();
|
}
|
||||||
break;
|
// fall through for ble-only chips
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
log_info("HCI_STATE_HALTING, calling sleep\n");
|
log_info("HCI_STATE_HALTING, calling sleep\n");
|
||||||
#if defined(USE_POWERMANAGEMENT) && defined(USE_BLUETOOL)
|
#if defined(USE_POWERMANAGEMENT) && defined(USE_BLUETOOL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user