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

[Gen4] ble: clear connecting flag on connected for peripheral role #2839

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

XuGuohui
Copy link
Member

Problem

When a device is connected as BLE peripheral, it cannot connect to a BLE periperhal device.

Solution

Reset the connecting_ flag on connected as BLE peripheral.

References

https://community.particle.io/t/ble-fails-to-connect-to-peripheral-as-central-after-connecting-as-a-peripheral-to-iphone/68477?u=ielec


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui added bug ble Bluetooth Low Energy labels Oct 17, 2024
@XuGuohui XuGuohui added this to the 6.2.1 milestone Oct 17, 2024
@@ -2381,6 +2381,7 @@ void BleGap::handleConnectionStateChanged(uint8_t connHandle, T_GAP_CONN_STATE n
LOG_DEBUG(TRACE, "Connected as Central");
} else {
connection.info.role = BLE_ROLE_PERIPHERAL;
connecting_ = false;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@XuGuohui XuGuohui Oct 17, 2024

Choose a reason for hiding this comment

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

When the device is acting as BLE peripheral, the device won't initiate the ATT MTU updating process, thus, that it won't hit that check, unless the BLE central device initiates the process. Under some circumstances, the BLE central device may omit this process. But for Gen4 platform that acts as BLE central role, from what we observed, it always initiates the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ble Bluetooth Low Energy bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants