Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

322
Views
How to stop monitorCharacteristic in React native ble-pplx

I'm having trouble with the monitorCharacteristicForService function in react-native-ble-plx. I want to stop the monitoring, but I don't seem to get it. Here is my code :

const getNumberOfTrames = async(device)=>{
    await device.writeCharacteristicWithResponseForService(serviceUUID, writeUUID, 'IzA5') 
    
    const monitorNumber = device.monitorCharacteristicForService(serviceUUID, readUUID, (error, a) => {

      if (error) {
        console.log('err',error)
        console.log('err',error.message)
      } else {
        console.log(base64.decode(a.value))
      }
    }, 'idMonitorNumber')

    return () => {
      console.log('REMOVED')
      monitorNumber.remove();
    }
  }

REMOVED is never printed on my console, even when I deconnect my bluetooth... I also tried with bleManager.cancelTransaction('idMonitorNumber') but it doesn't do anything either.

For information, I just call my function getNumberOfTrameswhen I press a button, but I have no other interaction with it. Maybe I need to say somewhere 'call the return function of getNumberOfTrames' ?

Can someone help me please ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!