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

109
Visualizações
How to write a hex array to the device

Because the device's document just let me know how to send byte-by-byte to communicate with the BLE Device. Example: When turn on the light, the command will be

Byte 0: 0x01, Byte 1: 0x32, Byte 2: 0x5A, Byte 3-4: 0x042A, Byte 5-18: 0x0024....2A, Byte 19-20: 0xB21F. I saw a lot of Bluetooth API document and example. When sending a value to device, we need to use

await characteristic.writeValue(Uint8Array.from(data))

But when I try to put a long hex buffer array like this [0x32,0x5A,0x04,0x2A,0x00,0x24,...,0x2A,0xB2,0x1F] into "data" I got an error like this:

NotSupportedError: GATT Error Unknown

But when I try a shorter command for changing some setting ([0x01,0x2a,0x58,0xab,0x00,0x1b,0xbf]) this error disappear.

So can I send a long Hex array to BLE device by Javascript code?

Sorry my English is not good and this is my first time asking in StackOverflow

about 4 years ago · Juan Pablo Isaza
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