Hi Rui,
Thank you for the excellent course ‘Learn ESP32 with Arduino’.
My application simply requires that one ESP32 BLE server transmit a 16-bit integer to a second ESP32 BLE client. It appears from your server/client example (where you convert temperature etc to a temporary string variable) that BLE only transmits characteristic value data as ASCII chars. Is that correct, or is it possible to transmit and receive Ints and Floats directly?
Thank you.
George.
Hello, the ESP32 BLE in Arduino IDE actually only supports char arrays (not strings) to set the values in the BLE characteristics:
char txString[8];
dtostrf(temperature, 1, 2, txString);
pCharacteristic->setValue(txString);
So, you’ll need to convert your float values or int values to a char array in order to work properly…