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

130
Visualizações
Convert React native BLE response from device

I'm writing to you as I need help converting a reply from BLE device, and I want to convert it to comprehensible data, but I'm failing to. I'm using React native BLE manager library, and the documentation for the bluetooth device Is like this.

"peripheral": "D6:AD:15:67:4A:A5", "service": "XXXXX-XXXXX-XXXXXX", "value": [85, 0, 255, 0, 0, 13, 0, 96, 93, 0, 0, 0, 0, 0, 49, 0, 0, 0, 1, 0]

enter image description here

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

0

The value that is returned from your peripheral appear to map to the document like so:

 85 = 0x55 = ACK Header
  0 = 0x00 = ACKCMD
255 = 0xFF = ~ACKCMD_OK
0, 0 = 0x0000 = ACK_PKT_NR
13, 0 = 0x0d = ACK_BUF_SIZE
   96 = 0x60 = SpO2
93, 0 = 0x5d00 = Pulse Rate
0, 0, 0, 0 = 0x00000000 = Step Count
49 = 0x31 = Battery
0 = 0x00 = Charging Status
0 = 0x00 = 3-axis
0 = 0x00 = PI
1 = 0x01 = Current state
0 = 0x00 = Reserved

To get at those values the code would be something like:

const bytes = new Uint8Array([85, 0, 255, 0, 0, 13, 0, 96, 93, 0, 0, 0, 0, 0, 49, 0, 0, 0, 1, 0]);
const pulse = new DataView(bytes.buffer).getUint16(8, true) 
const battery = new Uint8Array(bytes.buffer)[14];
console.log('Pulse Rate:' + pulse);
console.log('Battery Leve:' + battery);

about 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