Good afternoon,
I would like your help please. I need to read the bluetooth client address right after pairing.
I've been looking around the web for a while and found this code (I'm posting below the problem description).
Does anyone maybe know the command (second line) to implement the conditional instruction right after pairing. At the moment
manages to read the bluetooth mac address but only after opening a terminal e.g. on a smartphone and the pairing itself has no effect.
Thanks in advance for your help.
void callback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) {
if (event == ESP_SPP_SRV_OPEN_EVT){
Serial.println("Client Connected has address:");
for (int i = 0; i < 6; i++) {
Serial.printf("X", param->srv_open.rem_bda );
if (i < 5) {
Serial.print(":");
}
}
}
}
source: https://techtutorialsx.com/2018/12/11/esp32-arduino-serial-over-bluetooth-get-client-address/
I would like your help please. I need to read the bluetooth client address right after pairing.
I've been looking around the web for a while and found this code (I'm posting below the problem description).
Does anyone maybe know the command (second line) to implement the conditional instruction right after pairing. At the moment
manages to read the bluetooth mac address but only after opening a terminal e.g. on a smartphone and the pairing itself has no effect.
Thanks in advance for your help.
void callback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) {
if (event == ESP_SPP_SRV_OPEN_EVT){
Serial.println("Client Connected has address:");
for (int i = 0; i < 6; i++) {
Serial.printf("X", param->srv_open.rem_bda );
if (i < 5) {
Serial.print(":");
}
}
}
}
source: https://techtutorialsx.com/2018/12/11/esp32-arduino-serial-over-bluetooth-get-client-address/