Skip to content

Cancel connect no longer needs address #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions ble-cliapp/source/Commands/GapCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,15 +1388,9 @@ DECLARE_CMD(WaitForDisconnection) {

DECLARE_CMD(CancelConnect) {
CMD_NAME("cancelConnect")
CMD_ARGS(
CMD_ARG("ble::peer_address_type_t::type", "peerAddressType", ""),
CMD_ARG("ble::address_t", "peerAddress", "")
)
CMD_HANDLER(
ble::peer_address_type_t::type peerAddressType,
ble::address_t &peerAddress,
CommandResponsePtr& response) {
ble_error_t err = gap().cancelConnect(peerAddressType, peerAddress);
ble_error_t err = gap().cancelConnect();
reportErrorOrSuccess(response, err);
}
};
Expand Down
4 changes: 2 additions & 2 deletions test_suite/gap/test_gap_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_cancel_connect(central, peripheral):
central.gap.startConnecting(peripheral_address["address_type"], peripheral_address["address"])

sleep(0.5)
central.gap.cancelConnect(peripheral_address["address_type"], peripheral_address["address"])
central.gap.cancelConnect()
sleep(0.5)

# after we already stopped trying to connect start advertising but expect to fail to connect
Expand All @@ -61,7 +61,7 @@ def test_cancel_connect_too_late(central, peripheral):
central_handle, peripheral_handle = gap_connect(central, peripheral)

# we cancel after the connection completes and it should have no effect
central.gap.cancelConnect(peripheral_address["address_type"], peripheral_address["address"]).result
central.gap.cancelConnect().result

sleep(2)

Expand Down