added gap_le_set_scan_parameters to daemon

This commit is contained in:
matthias.ringwald 2014-06-07 08:06:25 +00:00
parent ef11999f21
commit 0fdde038bc
4 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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];

View File

@ -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

View File

@ -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