Arduino Array Structure BLE WriteValue - Programming Questions

Arduino Array Structure BLE writeValue Projects Programming April 11, 2022, 6:59pm 1

Dear Community,

I have successfully hacked myself into a Furby with the Arduino Wifi Rev2 via Bluetooth BLE. I can connect to the Furby characteristics perfectly: https://github.com/Jeija/bluefluff . Now I need to send a byte array to the characteristic. Unfortunately the ArduinoBLE Libary does not give an example on how to do this.

I am trying to make the Furby beatbox, here is a list of all action commands. https://github.com/Jeija/bluefluff/blob/master/doc/actionlist.md

I tried to define the array like this :

byte furbyBeatBox[6] = {0x13,0x00,0x18,0x00,0x01,0x07};

And write it to the characteristic like this:

simpleKeyCharacteristic.writeValue(furbyBeatBox,6);

Unfortunately this does not work. I can successfully write this single byte command:

simpleKeyCharacteristic.writeValue((byte)0xdb);

I will write a nice tutorial after I figured this out. Thanks for any help you guys can provide.

April 11, 2022, 11:53pm 2

how did you define simpleKeyCharacteristic?

April 13, 2022, 6:19am 3

Hi J-M-L, simpleKeyCharacteristic is defined as:

BLECharacteristic simpleKeyCharacteristic = peripheral.characteristic("dab91383-b5a1-e29c-b041-bcd562613bde");

and peripheral as:

BLEDevice peripheral = BLE.available();

It would be amazing if someone can enlighten me how to send this Byte Array via writeValue.

Thanks for any help.

April 13, 2022, 5:05pm 4

use this constructor

BLECharacteristic(const char* uuid, uint8_t properties, int valueSize, bool fixedLength = false);

and you can pass the value size (number of bytes) you want to allocate

October 10, 2022, 5:05pm 5

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

Topic Replies Views Activity
Using BLECharacteristic.writeValue() for byte arrays Programming 4 10815 May 6, 2021
Envío de String mediante Librería Arduino BLE (SOLUCIONADO) Software 8 1997 May 7, 2021
ESP32 BLE Peripheral - how to set long characteristic value? Programming 2 1334 May 22, 2023
BLE writevalue help Programming 20 714 November 11, 2024
BLE characteristic syntax question Programming 4 546 May 14, 2022
Unfortunately, your browser is unsupported. Please switch to a supported browser to view rich content, log in and reply.

Tag » Arduino Ble Send Byte Array