diff --git a/include/btstack/hci_cmds.h b/include/btstack/hci_cmds.h index 1380d01b7..afb299d47 100644 --- a/include/btstack/hci_cmds.h +++ b/include/btstack/hci_cmds.h @@ -623,6 +623,7 @@ extern const hci_cmd_t rfcomm_persistent_channel_for_service; extern const hci_cmd_t gap_disconnect_cmd; extern const hci_cmd_t gap_le_scan_start; extern const hci_cmd_t gap_le_scan_stop; +extern const hci_cmd_t gap_le_set_scan_parameters; extern const hci_cmd_t gap_le_connect_cmd; extern const hci_cmd_t gap_le_connect_cancel_cmd; extern const hci_cmd_t gatt_discover_primary_services_cmd; diff --git a/src/daemon.c b/src/daemon.c index 60583f0c1..a8cbbc3b6 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -540,6 +540,9 @@ static int btstack_command_handler(connection_t *connection, uint8_t *packet, ui case GAP_LE_SCAN_STOP: le_central_stop_scan(); break; + case GAP_LE_SET_SCAN_PARAMETERS: + le_central_set_scan_parameters(packet[3], READ_BT_16(packet, 4), READ_BT_16(packet, 6)); + break; case GAP_LE_CONNECT: bt_flip_addr(addr, &packet[4]); addr_type = packet[3]; diff --git a/src/hci.h b/src/hci.h index 32b1ec7e8..0df05a639 100644 --- a/src/hci.h +++ b/src/hci.h @@ -193,6 +193,7 @@ extern "C" { #define GAP_LE_SCAN_STOP 0x61 #define GAP_LE_CONNECT 0x62 #define GAP_LE_CONNECT_CANCEL 0x63 +#define GAP_LE_SET_SCAN_PARAMETERS 0x64 // GATT (Client) 0x70 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES 0x70 diff --git a/src/hci_cmds.c b/src/hci_cmds.c index fcf3b02a1..d13b92135 100644 --- a/src/hci_cmds.c +++ b/src/hci_cmds.c @@ -768,6 +768,15 @@ const hci_cmd_t gap_le_scan_stop = { OPCODE(OGF_BTSTACK, GAP_LE_SCAN_STOP), "" }; +/** + * @param scan_type + * @param scan_interval + * @param scan_window + */ +const hci_cmd_t gap_le_set_scan_parameters = { +OPCODE(OGF_BTSTACK, GAP_LE_SET_SCAN_PARAMETERS), "122" +}; + /** * @param peer_address_type * @param peer_address