Hi,
I am trying to send data of an accelorometer through bluetooth of ESP32 to an android cellphone. My knowledge about blueooth is so basic. According to my undrestanding from my studying about bluetooth BLE, here ESP32 acts as server and cellphone is the client.
My question is that to reach this goal which one of the available examles in esp_idf is more suitable to use? Since I see both examples named "ble_spp_server" and "gatt_server", and I don't undrestand which one should I use for this purpose?
I appreciate any answer.
How to use ESP32 as server to send data of a sensor through its bluetuth
-
- Posts: 3
- Joined: Mon Nov 27, 2017 12:32 am
Re: How to use ESP32 as server to send data of a sensor through its bluetuth
Have you looked up what ssp does?
I bet you could accomplish it with spp too, but I would go for GATT.
GATT is more structured, you can have a accelerometer "GATT Service", with a characteristic for each variable it produces. update each variable as it changes and have GATT on the phone notified of the change.Serial Port Profile (SPP) If you're replacing a serial communication interface (like RS-232 or a UART) with Bluetooth, SPP is the profile for you. SPP is great for sending bursts of data between two devices.
Bluetooth Basics - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/bl ... h-profiles
I bet you could accomplish it with spp too, but I would go for GATT.
Re: How to use ESP32 as server to send data of a sensor through its bluetuth
Hi,
I used "esp_ble_gatts_send_indicate" function in "esp_gatts_api.h".
Bye!
I used "esp_ble_gatts_send_indicate" function in "esp_gatts_api.h".
Bye!
Who is online
Users browsing this forum: No registered users and 54 guests