Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
Why cant i see any notifications when i send data to device over BLE?

I'm trying to make an app that sends commands to a BLE device and i cant get any feedback. I am using a library called ble.plx which has an option to monitor characteristics but it wont output anything for me. I need to read values from notifications to use later in my code. This is my first time working with BLE in general so i have no idea what i am doing wrong. I know serviceUUID and characteristicUUID are correct. I am out of ideas.

Here is my code:

function scanAndConnect() {
BLTManager.startDeviceScan(null, null, (error, device) => {
    if (error) {
        // Handle error (scanning will be stopped automatically)
        return
    }

    // Check if it is a device you are looking for based on advertisement data
    // or other criteria.
    if (device.name=='Audio PCM Streamer') {
        console.log(device.name);
        // Stop scanning as it's not necessary if you are scanning for one device.
        BLTManager.stopDeviceScan();

        device.connect()
        .then((device) => {
          return device.discoverAllServicesAndCharacteristics()
        })
        .then( (device) => {
          device.monitorCharacteristicForService(SERVICE_UUID,CHARACTERISTIC_UUID,(err,result)=>{
            if(err) {
              console.log(err)
              return;
            }
            console.log(result);
          }); Subscription  
          device.requestMTU(251)
          let data = Uint8Array(9);
          data[0]=0xA5;
          data[1]=0xA5;
          data[2]=0xA5;
          data[3]=0xA5;
          var b64encoded = btoa(decoder.decode(data));
          device.writeCharacteristicWithoutResponseForService(SERVICE_UUID,CHARACTERISTIC_UUID,b64encoded);

        
        })
        .catch((error) => {
    // Handle errors
        });

       }
    });

}

almost 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I did this completely wrong do not use this or try to fix this its just bad.

almost 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda