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

Unable to use GATT server with central role #326

Open
bradjc opened this issue Jul 6, 2017 · 1 comment
Open

Unable to use GATT server with central role #326

bradjc opened this issue Jul 6, 2017 · 1 comment

Comments

@bradjc
Copy link

bradjc commented Jul 6, 2017

I'm trying to use noble and bleno together in a single application to allow linux to be in the central role but also be the GATT server. I actually have this working, but had to remove an if statement in bleno. Namely, I had to remove this if:

BlenoBindings.prototype.onLeConnComplete = function(status, handle, role, addressType, address, interval, latency, supervisionTimeout, masterClockAccuracy) {
  // if (role !== 1) {
  //   // not slave, ignore
  //   return;
  // }
  ...
}

from here.

With that if the AclStream never gets set up and bleno never responds to discover services requests (or any other request).

I understand why that check is there, since a connection callback is valid in both the central and peripheral contexts, however, I believe a GATT server is equally valid in both contexts. Any thoughts on this? Would an environment variable be the right approach to skip that check in cases like mine?

@horihiro
Copy link

horihiro commented Nov 4, 2017

I use bleno and noble to develop node-fitbit-livedata module for getting live data from fitbit devices.
I also have met this problem when these modules work on Raspbian.

This workaround is useful for me.

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

3 participants