noble / bleno

A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals
MIT License
2.12k stars 447 forks source link

Issue when used along with Web Bluetooth platform if the length UUID of service is 32 #378

Open venkatraopasupuleti opened 6 years ago

venkatraopasupuleti commented 6 years ago

https://github.com/noble/bleno/blob/72028bc995d55cb9dcf223f9b0ffce563d091212/lib/hci-socket/gatt.js#L551

Web Ble code:

navigator.bluetooth.requestDevice({ filters: [{ services: ['4ac4d160-48a0-11e8-b566-0800200c9a66'] }] })
.then(device => device.gatt.connect())
.then(server => {
  // Getting Battery Service...
  return server.getPrimaryService('battery_service');
}).then(service=>{
//service is undefined
})

The service becomes undefined as Gatt.prototype.handleReadByGroupRequest is not returning the 32 bit UUID primary service in the response.

sandeepmistry commented 6 years ago

@venkatraopasupuleti please provide a minimal example app that can be used to reproduce this.