set le scan parameters during init

This commit is contained in:
matthias.ringwald 2014-06-07 07:49:16 +00:00
parent 11d5dec16d
commit 8ebb5506d7

View File

@ -1603,7 +1603,7 @@ void hci_run(){
hci_stack->substate = 11 << 1; // skip all classic command hci_stack->substate = 11 << 1; // skip all classic command
} else { } else {
log_error("Neither BR/EDR nor LE supported"); log_error("Neither BR/EDR nor LE supported");
hci_stack->substate = 13 << 1; // skip all hci_stack->substate = 14 << 1; // skip all
} }
} }
break; break;
@ -1644,7 +1644,7 @@ void hci_run(){
hci_send_cmd(&hci_write_scan_enable, (hci_stack->connectable << 1) | hci_stack->discoverable); // page scan hci_send_cmd(&hci_write_scan_enable, (hci_stack->connectable << 1) | hci_stack->discoverable); // page scan
if (!hci_le_supported()){ if (!hci_le_supported()){
// SKIP LE init for Classic only configuration // SKIP LE init for Classic only configuration
hci_stack->substate = 13 << 1; hci_stack->substate = 14 << 1;
} }
break; break;
@ -1657,10 +1657,14 @@ void hci_run(){
// LE Supported Host = 1, Simultaneous Host = 0 // LE Supported Host = 1, Simultaneous Host = 0
hci_send_cmd(&hci_write_le_host_supported, 1, 0); hci_send_cmd(&hci_write_le_host_supported, 1, 0);
break; break;
case 14:
// LE Scan Parameters: active scanning, 300 ms interval, 30 ms window, public address, accept all advs
hci_send_cmd(&hci_le_set_scan_parameters, 1, 0x1e0, 0x30, 0, 0);
break;
#endif #endif
// DONE // DONE
case 14: case 15:
// done. // done.
hci_stack->state = HCI_STATE_WORKING; hci_stack->state = HCI_STATE_WORKING;
hci_emit_state(); hci_emit_state();