Skip to content
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

BLE remove address from API to cancel connect #13462

Merged

Conversation

paul-szczepanek-arm
Copy link
Member

@paul-szczepanek-arm paul-szczepanek-arm commented Aug 18, 2020

Summary of changes

Allow cancel connect without address. This means it will cancel any outgoing connection. Not necessarily the one we meant. But since there is only one outgoing connection allowed at any one time this is fine.

Impact of changes

Migration actions required

Documentation

none


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Reviewers

@pan-

@paul-szczepanek-arm
Copy link
Member Author

test_gap_connection.py::test_cancel_connect 
------------------------------ live log teardown -------------------------------
18:17:12.182   INFO   -->|peripheral| ble shutdown
18:17:12.186   INFO   <--|peripheral| {"status": 0}
18:17:12.187   INFO   <--|peripheral| retcode: 0
18:17:12.187   INFO   -->|peripheral| echo on
18:17:12.191   INFO   <--|peripheral| ECHO is on
18:17:12.192   INFO   <--|peripheral| retcode: 0
18:17:12.192   INFO   -->|peripheral| set --vt100 on
18:17:12.195   INFO   <--|peripheral| 
18:17:12.197   INFO   <--|peripheral| retcode: 0
18:17:12.197   INFO   Stopping "peripheral" runner...
18:17:12.197   INFO   -->|peripheral| set retcode false
18:17:12.231   INFO   <--|peripheral| />set retcode false
18:17:12.298   INFO   -->|central| ble shutdown
18:17:12.303   INFO   <--|central| {"status": 0}
18:17:12.304   INFO   <--|central| retcode: 0
18:17:12.304   INFO   -->|central| echo on
18:17:12.308   INFO   <--|central| ECHO is on
18:17:12.309   INFO   <--|central| retcode: 0
18:17:12.309   INFO   -->|central| set --vt100 on
18:17:12.313   INFO   <--|central| 
18:17:12.313   INFO   <--|central| retcode: 0
18:17:12.313   INFO   Stopping "central" runner...
18:17:12.314   INFO   -->|central| set retcode false
18:17:12.347   INFO   <--|central| />set retcode false


============================== 1 passed in 8.74s ===============================

Process finished with exit code 0

-------------------------------- live log setup --------------------------------
18:17:03.701   INFO   Starting runner threads for "central"
18:17:04.227   INFO   <--|central| ARM Ltd
18:17:04.813   INFO   -->|central| set --retcode true
18:17:04.850   INFO   <--|central| />set --retcode true
18:17:04.851   INFO   <--|central| retcode: 0
18:17:04.851   INFO   -->|central| echo off
18:17:04.866   INFO   <--|central| />echo off
18:17:04.866   INFO   <--|central| ECHO is off
18:17:04.867   INFO   <--|central| retcode: 0
18:17:04.867   INFO   -->|central| set --vt100 off
18:17:04.871   INFO   <--|central| retcode: 0
18:17:04.872   INFO   -->|central| ble init
18:17:04.889   INFO   <--|central| {"status": 0}
18:17:04.890   INFO   <--|central| retcode: 0
18:17:04.892   INFO   Starting runner threads for "peripheral"
18:17:05.409   INFO   <--|peripheral| ARM Ltd
18:17:06.006   INFO   -->|peripheral| set --retcode true
18:17:06.042   INFO   <--|peripheral| />set --retcode true
18:17:06.044   INFO   <--|peripheral| retcode: 0
18:17:06.044   INFO   -->|peripheral| echo off
18:17:06.057   INFO   <--|peripheral| />echo off
18:17:06.058   INFO   <--|peripheral| ECHO is off
18:17:06.060   INFO   <--|peripheral| retcode: 0
18:17:06.060   INFO   -->|peripheral| set --vt100 off
18:17:06.065   INFO   <--|peripheral| retcode: 0
18:17:06.065   INFO   -->|peripheral| ble init
18:17:06.083   INFO   <--|peripheral| {"status": 0}
18:17:06.084   INFO   <--|peripheral| retcode: 0
-------------------------------- live log call ---------------------------------
18:17:06.085   INFO   -->|peripheral| gap getAddress
18:17:06.095   INFO   <--|peripheral| {"status": 0,"result": {"address_type": "RANDOM","address": "D8:E2:FB:7F:0A:A8"}}
18:17:06.096   INFO   <--|peripheral| retcode: 0
18:17:06.096   INFO   -->|central| gap startConnecting RANDOM D8:E2:FB:7F:0A:A8
18:17:06.105   INFO   <--|central| {"status": 0}
18:17:06.106   INFO   <--|central| retcode: 0
18:17:06.608   INFO   -->|central| gap cancelConnect
18:17:06.612   INFO   <--|central| {"status": 0}
18:17:06.613   INFO   <--|central| retcode: 0
18:17:07.115   INFO   -->|peripheral| advDataBuilder clear
18:17:07.121   INFO   <--|peripheral| {"status": 0}
18:17:07.122   INFO   <--|peripheral| retcode: 0
18:17:07.123   INFO   -->|peripheral| advDataBuilder setFlags LE_GENERAL_DISCOVERABLE
18:17:07.130   INFO   <--|peripheral| {"status": 0}
18:17:07.131   INFO   <--|peripheral| retcode: 0
18:17:07.131   INFO   -->|peripheral| advDataBuilder setFlags BREDR_NOT_SUPPORTED
18:17:07.139   INFO   <--|peripheral| {"status": 0}
18:17:07.140   INFO   <--|peripheral| retcode: 0
18:17:07.140   INFO   -->|peripheral| gap applyAdvPayloadFromBuilder 0
18:17:07.146   INFO   <--|peripheral| {"status": 0}
18:17:07.148   INFO   <--|peripheral| retcode: 0
18:17:07.148   INFO   -->|peripheral| advParams setType CONNECTABLE_UNDIRECTED
18:17:07.155   INFO   <--|peripheral| {"status": 0}
18:17:07.156   INFO   <--|peripheral| retcode: 0
18:17:07.157   INFO   -->|peripheral| gap setAdvertisingParameters 0
18:17:07.163   INFO   <--|peripheral| {"status": 0}
18:17:07.163   INFO   <--|peripheral| retcode: 0
18:17:07.164   INFO   -->|peripheral| gap startAdvertising 0 0 0
18:17:07.170   INFO   <--|peripheral| {"status": 0}
18:17:07.171   INFO   <--|peripheral| retcode: 0
18:17:07.171   INFO   -->|peripheral| gap waitForConnection 5000
18:17:08.172   INFO   peripheral: Waiting for "retcode: -1" string... Timeout in 29 s
18:17:08.177   INFO   <--|peripheral| {
18:17:09.179   INFO   peripheral: Waiting for "retcode: -1" string... Timeout in 28 s
18:17:10.180   INFO   peripheral: Waiting for "retcode: -1" string... Timeout in 27 s
18:17:11.181   INFO   peripheral: Waiting for "retcode: -1" string... Timeout in 26 s
18:17:12.180   INFO   <--|peripheral| "status": -1,"error": "timeout"}
18:17:12.181   INFO   <--|peripheral| retcode: -1
PASSED                                                                   [100%]

@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 18, 2020
@ciarmcom ciarmcom requested review from pan- and a team August 18, 2020 17:30
@ciarmcom
Copy link
Member

@paul-szczepanek-arm, thank you for your changes.
@pan- @ARMmbed/mbed-os-maintainers please review.

Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify bot added needs: CI and removed needs: review labels Aug 19, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@0xc0170 0xc0170 merged commit d6e93b1 into ARMmbed:master Aug 25, 2020
@mergify mergify bot removed the ready for merge label Aug 25, 2020
@mbedmain mbedmain added release-version: 6.3.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants