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

128
Views
Convierta la respuesta BLE nativa de React desde el dispositivo

Le escribo porque necesito ayuda para convertir una respuesta de un dispositivo BLE y quiero convertirla en datos comprensibles, pero no lo consigo. Estoy usando la biblioteca del administrador BLE nativo de React, y la documentación para el dispositivo bluetooth es así.

 "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]

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El valor que se devuelve desde su periférico parece asignarse al documento de la siguiente manera:

 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

Para llegar a esos valores, el código sería algo como:

 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 Report
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!