cordova-plugin-bluetoothle icon indicating copy to clipboard operation
cordova-plugin-bluetoothle copied to clipboard

Subscribe Error: Service not Found

Open rfbezerra opened this issue 7 years ago • 3 comments

Hi,

Im trying to communicate with a custom equipment without success. My needs is for running my app in Android 4.4 (API 19), so, I'm using old 2.4.0 version.

I can connect, discover services, disconnect. My problem is when subscribe to a characteristic: "Service not found"

Here is the discover results:

{
  "address":"XX:XX:XX:XX:XX:XX",
  "status":"discovered",
  "services":[{
    "characteristics":[{
      "descriptors":[],
      "characteristicUuid":"2a00",
      "properties":{"read":true}
    },{
      "descriptors":[],
      "characteristicUuid":"2a01",
      "properties":{"read":true}
    },{
      "descriptors":[],
      "characteristicUuid":"2a02",
      "properties":{"write":true, "read":true}
    },{
      "descriptors":[],
      "characteristicUuid":"2a03",
      "properties":{"write":true, "read":true}
    },{
      "descriptors":[],
      "characteristicUuid":"2a04",
      "properties":{"read":true}
    }],
    "serviceUuid":"1800"
  },{
    "characteristics":[{
      "descriptors":[{"descriptorUuid":"2902"}],
      "characteristicUuid":"2a05",
      "properties":{"indicate":true}
    }],
    "serviceUuid":"1801"
  },{
    "characteristics":[{
      "descriptors":[{"descriptorUuid":"2902"},{"descriptorUuid":"2901"}],
      "characteristicUuid":"ffe1",
      "properties":{
        "writeWithoutResponse":true,
        "read":true,
        "notify":true
      }
    }],
    "serviceUuid":"ffe0"
  }],
  "name":"PeripheralName"
}

And error occurr with:

bluetoothle.subscribe(resolve, reject, {
  address: 'XX:XX:XX:XX:XX:XX',
  service: 'ffe0',
  characteristic: 'ffe1',
})
{"message":"Service not found","error":"service","address":"XX:XX:XX:XX:XX:XX","name":"PeripheralName"}

Did I miss something?

Thanks

rfbezerra avatar Apr 19 '18 19:04 rfbezerra

When I subscribe neither the success nor failure functions fire

chicag0 avatar May 01 '18 17:05 chicag0

Hi, how are you? I have the same problem, were you able to solve that?

marcui13 avatar Feb 08 '23 15:02 marcui13

you must discover to update data used by the library.. until you do, you cannot read/write, or connect really

sdetweil avatar Jun 30 '23 21:06 sdetweil