bleCharacteristics.redValue!

Hello,

I try to get data via BLE into my Arduino MKR Wifi 1010.
I get a value of a characteristics when I write the follwoing code line:
simpleKeyCharacteristic.readValue(value);

If i visit the reference of readValue() in the reference:

there is showen a second option to get data:

bleCharacteristic.readValue(buffer, length)

What do I have to write as buffer & length and in what datatyp should they be?

thank you

wuesim:
What do I have to write as buffer

You create a buffer large enough to contain the data to be read and then pass it to the readValue() function:

byte buffer[42];
simpleKeyCharacteristic.readValue(buffer, 42);

wuesim:
what datatyp should they be?

The type of the buffer parameter is an array of bytes (actually the type is int8_t, but byte is a type alias for int8_t on the MKR WiFi 1010 so they are the same thing). The type of the length parameter is int.

Fine! Thank You!

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per