I am a beginner with ESP32 and I am trying to add passkey request when a client connects to BLE_SPP_SERVER_DEMO application. I gave a look to the gatt security server example and I tried to merge the two but with no success so far.
In the BLE spp server demo I tried to add:
Code: Select all
esp_ble_auth_req_t auth_req = ESP_LE_AUTH_BOND; //bonding with peer device after authentication
esp_ble_io_cap_t iocap = ESP_IO_CAP_OUT;
esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &auth_req, sizeof(uint8_t));
esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t));
Code: Select all
case ESP_GAP_BLE_PASSKEY_NOTIF_EVT:
///show the passkey number to the user to input it in the peer deivce.
ESP_LOGI(GATTS_TABLE_TAG, "The passkey Notify number:%06d", param->ble_security.key_notif.passkey);
break;
Can you kindly point me in the right direction?
Many thanks!