Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
How can I extract NumS , NumV , Sig Models from sequence of string octets which is basically a composition data?

0C001A0001000800030000010501000000800100001003103F002A00

The above Composition Data Page 0 can be described as follows:

0C00 1A00 0100 0800 0300 0001 05 01 0000 0080 0100 0010 0310 3F002A00

  • CID is 0x000C
  • PID is 0x001A
  • VID is 0x0001
  • CRPL is 0x0008
  • Features is 0x0003 – Relay and Friend features.
  • Loc is "front" – 0x0100
  • NumS is 5
  • NumV is 1
  • The Bluetooth SIG Models supported are:
    • 0x0000, 0x8000, 0x0001, 0x1000, 0x100

Note: The composition data is little-endian.

I know the usage of Arraybuffer and untyped arrays but confused about how to set offset according to extraction of different IDs and SIG Models. I have to make changes in this code (extracting first 4 IDs), particularly:

var string  = "0123 4567 89AB";

var string1 =  string.split(" ").join(""); 
          
var buf = new ArrayBuffer(string1.length/2); 

var hex = new Uint16Array(buf)
     
for (var i=0, strLen=string1.length; i < strLen; i+=4){

    hex[i/4] = 0


    hex[i/4] += (parseInt(string1[i+0],16) << (4*1))
    hex[i/4] += (parseInt(string1[i+1],16) << (4*0))
    hex[i/4] += (parseInt(string1[i+2],16) << (4*3))
    hex[i/4] += (parseInt(string1[i+3],16) << (4*2))
}

for (var i=0, strLen=string1.length; i < strLen/4; i++){

    document.write("0x0" + hex[i].toString(16))
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda