Skip to content

CurieBLE: BLEPeripheral::connected() always returns false #444

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

Closed
sandeepmistry opened this issue Feb 17, 2017 · 4 comments
Closed

CurieBLE: BLEPeripheral::connected() always returns false #444

sandeepmistry opened this issue Feb 17, 2017 · 4 comments
Assignees
Milestone

Comments

@sandeepmistry
Copy link
Contributor

Observed while debugging: #377 (comment)

#include <CurieBLE.h>

BLEPeripheral blePeripheral;

void setup() {
  Serial.begin(9600);
  while(!Serial);

  blePeripheral.setLocalName("test");

  blePeripheral.begin();
}

void loop() {
  if (blePeripheral.connected()) {
    Serial.println("connected");

    while (blePeripheral.connected());

    Serial.println("disconnected");
  }

}

if i connect from a central, "connected" is never printed.

sgbihu added a commit to sgbihu/corelibs-arduino101 that referenced this issue Feb 20, 2017
1. Root casue: the stack need use connected device to get the state.
    The current code used local address to get the link and get an error.
2. Solution: Use central's address to get connection state.
sgbihu added a commit to sgbihu/corelibs-arduino101 that referenced this issue Feb 20, 2017
1. Root casue: the stack need use connected device to get the state.
    The current code used local address to get the link and get an error.
2. Solution: Use central's address to get connection state.
@sgbihu
Copy link
Contributor

sgbihu commented Feb 20, 2017

Fixed.

@kitsunami kitsunami added this to the Deneb milestone Feb 21, 2017
@SidLeung
Copy link
Contributor

Jira ticket 857 is assigned to track this issue.

@russmcinnis
Copy link
Contributor

We ran a round of BAT tests along with some manual things that require close timing and everything passes. The test sketch here is showing connected when running against nRF on Android phone. So it looks like the return value has been fixed.

sgbihu added a commit to sgbihu/corelibs-arduino101 that referenced this issue Feb 23, 2017
1. Root casue: the stack need use connected device to get the state.
    The current code used local address to get the link and get an error.
2. Solution: Use central's address to get connection state.
SidLeung pushed a commit to SidLeung/corelibs-arduino101 that referenced this issue Feb 23, 2017
1. Root casue: the stack need use connected device to get the state.
    The current code used local address to get the link and get an error.
2. Solution: Use central's address to get connection state.
@kitsunami kitsunami assigned sandeepmistry and unassigned SidLeung Feb 24, 2017
@sandeepmistry
Copy link
Contributor Author

I tested with Github master d818a3a, this is fixed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants