prepare gap_le_connect_cancel command

This commit is contained in:
matthias.ringwald@gmail.com 2014-05-12 21:38:30 +00:00
parent ea3e9e661d
commit e31f89a786
5 changed files with 18 additions and 0 deletions

View File

@ -673,6 +673,7 @@ 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_connect_cmd;
extern const hci_cmd_t gap_le_connect_cancel_cmd;
extern const hci_cmd_t gatt_discover_primary_services_cmd;
#if defined __cplusplus

View File

@ -533,6 +533,9 @@ static int btstack_command_handler(connection_t *connection, uint8_t *packet, ui
addr_type = packet[3];
le_central_connect(&addr, addr_type);
break;
case GAP_LE_CONNECT_CANCEL:
le_central_connect_cancel();
break;
case GAP_DISCONNECT:
handle = READ_BT_16(packet, 3);
gap_disconnect(handle);

View File

@ -2206,6 +2206,10 @@ le_command_status_t le_central_connect(bd_addr_t * addr, bd_addr_type_t addr_typ
return BLE_PERIPHERAL_OK;
}
le_command_status_t le_central_connect_cancel(){
// TODO implement
return BLE_PERIPHERAL_OK;
}
le_command_status_t gap_disconnect(hci_con_handle_t handle){
hci_connection_t * conn = hci_connection_for_handle(handle);

View File

@ -192,6 +192,7 @@ extern "C" {
#define GAP_LE_SCAN_START 0x60
#define GAP_LE_SCAN_STOP 0x61
#define GAP_LE_CONNECT 0x62
#define GAP_LE_CONNECT_CANCEL 0x63
// GATT (Client) 0x70
#define GATT_DISCOVER_ALL_PRIMARY_SERVICES 0x70
@ -413,6 +414,7 @@ typedef struct {
le_command_status_t le_central_start_scan();
le_command_status_t le_central_stop_scan();
le_command_status_t le_central_connect(bd_addr_t * addr, bd_addr_type_t addr_type);
le_command_status_t le_central_connect_cancel();
le_command_status_t gap_disconnect(hci_con_handle_t handle);
//*************** le client end

View File

@ -776,6 +776,14 @@ const hci_cmd_t gap_le_connect_cmd = {
OPCODE(OGF_BTSTACK, GAP_LE_CONNECT), "1B"
};
/**
* @param peer_address_type
* @param peer_address
*/
const hci_cmd_t gap_le_connect_cancel_cmd = {
OPCODE(OGF_BTSTACK, GAP_LE_CONNECT_CANCEL), ""
};
/**
* @param handle
*/