I'm developing an application which involves a keypad. This keypad stores passwords and if the password matches, the ESP32 sends a signal. This part of the project is done and works well, my problem appears when I try to implement BLE.
I programmed a code to be able to change the password by the keyboard, pressing a key combination... this is done and works well, but I want to change this password via BLE. I'm currently using this example.
I understand some things of this code, and I'm able to communicate, sending and receiving using a mobile APP, but I want to "play" with the data. For example, I would like to send a signal when the ESP32 receives the word "Hi", but I don't know how to access the received/sent data.
I would like to do something like:
if (data == "Hi")
{
send signal
}
I know the received data would be in HEX, but I don't even know how to access this data.
1 Answer 1
It sounds like you want Bluetooth to give you serial data. It can, but you need to implement a serial port service. There should be examples of this on the web. On the app side, this also needs to work with the serial port service. You might want to search for SPP (serial port profile)
The received data is not in HEX. What gave you that impression? Hexadecimal is just a way of representing numbers. 0x20 is the same as decimal 32 or binary 00100000 Hex is just a convenient way of expressing binary values.