noble/bleno

Unable to use GATT server with central role

開放

#326 建立於 2017年7月6日

 (1 則留言) (1 個反應) (0 位負責人)JavaScript (465 個分叉)batch import
help wanted

倉庫指標

星標
 (2,083 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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?

貢獻者指南