Fix handling of security escalation in on_connection_complete()

pull/6932/head
Donatien Garnier 2018-05-16 13:54:25 +01:00
parent 3f7a7a4213
commit ad09ba0dcc
1 changed files with 4 additions and 3 deletions

View File

@ -1235,11 +1235,12 @@ void GenericGap::on_connection_complete(const pal::GapConnectionCompleteEvent& e
// Now starts pairing or authentication procedures if required // Now starts pairing or authentication procedures if required
if(needs_pairing) { if(needs_pairing) {
SecurityManager &sm = createBLEInstance()->getSecurityManager(); SecurityManager &sm = createBLEInstance()->getSecurityManager();
sm.requestPairing(e.connection_handle); // Request authentication to start pairing procedure
sm.requestAuthentication(e.connection_handle);
} }
else if(needs_authentication) { else if(needs_authentication) {
SecurityManager &sm = createBLEInstance()->getSecurityManager(); // TODO: GAP Authentication != Security Manager authentication
sm.requestAuthentication(e.connection_handle); // Needs to be implemented
} }
} else { } else {
// for now notify user that the connection failled by issuing a timeout // for now notify user that the connection failled by issuing a timeout