Merge pull request #632 from ccollins476ad/rm-conn-cancel

BLE Host - Remove BLE_GAP_EVENT_CONN_CANCEL

X-Original-Commit: 9844b16d31b4079b4646f80694c2f0639b98d79c
This commit is contained in:
ccollins476ad
2017-11-03 16:38:23 -07:00
committed by GitHub
3 changed files with 10 additions and 14 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ struct hci_conn_update;
#define BLE_GAP_EVENT_CONNECT 0
#define BLE_GAP_EVENT_DISCONNECT 1
#define BLE_GAP_EVENT_CONN_CANCEL 2
/* Reserved 2 */
#define BLE_GAP_EVENT_CONN_UPDATE 3
#define BLE_GAP_EVENT_CONN_UPDATE_REQ 4
#define BLE_GAP_EVENT_L2CAP_UPDATE_REQ 5
+5 -8
View File
@@ -725,18 +725,15 @@ ble_gap_master_connect_cancelled(void)
ble_gap_master_extract_state(&state, 1);
if (state.cb != NULL) {
/* The GAP event type depends on whether 1) the application manually
* cancelled the connect procedure or 2) the connect procedure timed
* out.
*/
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_CONNECT;
event.connect.conn_handle = BLE_HS_CONN_HANDLE_NONE;
if (state.conn.cancel) {
event.type = BLE_GAP_EVENT_CONN_CANCEL;
/* Connect procedure successfully cancelled. */
event.connect.status = BLE_HS_EAPP;
} else {
event.type = BLE_GAP_EVENT_CONNECT;
/* Connect procedure timed out. */
event.connect.status = BLE_HS_ETIMEOUT;
event.connect.conn_handle = BLE_HS_CONN_HANDLE_NONE;
}
state.cb(&event, state.cb_arg);
}
+4 -5
View File
@@ -104,9 +104,6 @@ ble_gap_test_util_connect_cb(struct ble_gap_event *event, void *arg)
TEST_ASSERT_FATAL(ret == 0);
break;
case BLE_GAP_EVENT_CONN_CANCEL:
break;
case BLE_GAP_EVENT_TERM_FAILURE:
ble_gap_test_conn_status = event->term_failure.status;
ret = ble_gap_conn_find(event->term_failure.conn_handle,
@@ -1062,7 +1059,8 @@ ble_gap_test_util_conn_cancel(uint8_t hci_status)
TEST_ASSERT(rc == 0);
TEST_ASSERT(!ble_gap_master_in_progress());
TEST_ASSERT(ble_gap_test_event.type == BLE_GAP_EVENT_CONN_CANCEL);
TEST_ASSERT(ble_gap_test_event.type == BLE_GAP_EVENT_CONNECT);
TEST_ASSERT(ble_gap_test_event.connect.status == BLE_HS_EAPP);
}
static void
@@ -1104,7 +1102,8 @@ TEST_CASE(ble_gap_test_case_conn_cancel_good)
ble_gap_test_util_conn_and_cancel(peer_addr, 0);
TEST_ASSERT(ble_gap_test_event.type == BLE_GAP_EVENT_CONN_CANCEL);
TEST_ASSERT(ble_gap_test_event.type == BLE_GAP_EVENT_CONNECT);
TEST_ASSERT(ble_gap_test_event.connect.status == BLE_HS_EAPP);
TEST_ASSERT(ble_gap_test_conn_desc.conn_handle == BLE_HS_CONN_HANDLE_NONE);
}