0
  const monitorchars =  DeviceManager.monitorCharacteristicForDevice(
    device.id,
    "00001800-0000-1000-8000-00805f9b34fb",
    "00002a01-0000-1000-8000-00805f9b34fb",  
    function (err, result) {
      if(err) {
        console.log(err)
        return;
      }
      console.log(result);
    });
  console.log(monitorchars)

I am using the react-native-ble-plx package.

I get read characteristics, read descriptors, and I am trying to write and notify props in react-native code. But, values are showing errors.

Can anyone can help to write and notify in ble-plx?

BleError: Characteristic X notify change failed for device Y and service Z

We are working on a device by using this we got services and their respective characteristics,among those characteristics we have one characteristic with notify property(isNotifiable:true,isNotifying:false) and a client characteristic configuration descriptor. now we want to make this isNotifying property value to true so that we can get some data stream from the device i refered this document ,in this there is a statement like "to set the notification value, we need to tell the sensor to enables us this notification mode. We will write to the characteristic’s descriptor to set the right value: Notify or Indicate." in ble-plx there is a method bleManager.writeDescriptorForDevice(), we tried using this but ended up with an error,

so,help me in getting the device data by making isNotifying property value true

Michael Kotzjan
  • 2,093
  • 2
  • 14
  • 23
Yaswanth
  • 1
  • 3
  • Please [edit] your question and add the errors you are getting – Michael Kotzjan Jan 25 '22 at 08:35
  • yes edit error in our code. check it once – Yaswanth Jan 25 '22 at 10:13
  • we are working on a device by using this we got services and their respective characteristics,among those characteristics we have one characteristic with notify property(isNotifiable:true,isNotifying:false) and continue.. next comment... – Yaswanth Jan 27 '22 at 05:53
  • client characteristic configuration descriptor.now we want to make this isNotifying property value to true so that we can get some data stream from the device i refered this document ,in this there is a statement like"to set the notification value,we need to tell the sensor to enables us this notification mode. We will write to the characteristic’s descriptor to set the right value: Notify or Indicate."in ble-plx there is a method leManager.writeDescriptorForDevice(),we tried using this but ended up with anerror, so,help me in getting the device data by making isNotifying property valuetrue – Yaswanth Jan 27 '22 at 05:56
  • Take a look at the documentation. There is a page about receiving notifications: https://github.com/dotintent/react-native-ble-plx/wiki/Characteristic-Notifying it also states: There is no need to write Client Characteristic Configuration descriptor at all. It is handled by the library/OS. – Michael Kotzjan Jan 27 '22 at 06:51
  • we already have tried writing deviceManager.monitorCharacteristicForDevice but the listener didnt responded(i.e.,neither getting error or characteristics) but when we have tried DeviceManager.writeCharacteristicWithResponseForDevice and then deviceManager.monitorCharacteristicForDevice then the listener has responded and we got a error:Characteristic {characteristicUUID} notify change failed for device {deviceID} and service {serviceUUID}", – Yaswanth Jan 27 '22 at 07:37
  • Have you tried a generic BLE scanner such as [nRF Connect](https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-mobile) to check which characteristic actually allows notifications and to test them? – Michael Kotzjan Jan 27 '22 at 07:47
  • yes,we have refered a similiar app bledebugger,other than that our code also shown a characteristic with isNotifyble property value as true,isNotifyble:false,but we don't know how to send notify for device so that we can get isNotifying property value as true and can access the additional data from device – Yaswanth Jan 27 '22 at 08:16
  • There is an issue describing something similar, maybe you need to open one as well: https://github.com/dotintent/react-native-ble-plx/issues/784 – Michael Kotzjan Jan 27 '22 at 08:25
  • we are trying from many days to get data but couldn't get it. so if you have any reference code plz share – Yaswanth Jan 27 '22 at 10:15

0 Answers0