sm.c (e2a5eb6349242fe8c0617013ed0e1adeacc70d8d) | sm.c (434260a1677a12eed27a1f625a33f1963a649b5a) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 1318 unchanged lines hidden (view full) --- 1327 1328 if (IS_RESPONDER(sm_connection->sm_role)) { 1329#ifdef ENABLE_LE_PERIPHERAL 1330 // IRK required before, continue 1331 if (sm_connection->sm_engine_state == SM_RESPONDER_PH0_RECEIVED_LTK_W4_IRK){ 1332 sm_connection->sm_engine_state = SM_RESPONDER_PH0_RECEIVED_LTK_REQUEST; 1333 break; 1334 } | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 1318 unchanged lines hidden (view full) --- 1327 1328 if (IS_RESPONDER(sm_connection->sm_role)) { 1329#ifdef ENABLE_LE_PERIPHERAL 1330 // IRK required before, continue 1331 if (sm_connection->sm_engine_state == SM_RESPONDER_PH0_RECEIVED_LTK_W4_IRK){ 1332 sm_connection->sm_engine_state = SM_RESPONDER_PH0_RECEIVED_LTK_REQUEST; 1333 break; 1334 } |
1335 // Pairing request before, continue |
|
1335 if (sm_connection->sm_engine_state == SM_RESPONDER_PH1_PAIRING_REQUEST_RECEIVED_W4_IRK){ 1336 sm_connection->sm_engine_state = SM_RESPONDER_PH1_PAIRING_REQUEST_RECEIVED; 1337 break; 1338 } 1339 bool trigger_security_request = sm_connection->sm_pairing_requested || sm_slave_request_security; 1340 sm_connection->sm_pairing_requested = false; 1341#ifdef ENABLE_LE_PROACTIVE_AUTHENTICATION 1342 // trigger security request for Proactive Authentication if LTK available --- 56 unchanged lines hidden (view full) --- 1399 case ADDRESS_RESOLUTION_FAILED: 1400 sm_connection->sm_irk_lookup_state = IRK_LOOKUP_FAILED; 1401 if (IS_RESPONDER(sm_connection->sm_role)) { 1402#ifdef ENABLE_LE_PERIPHERAL 1403 // LTK request received before, IRK required -> negative LTK reply 1404 if (sm_connection->sm_engine_state == SM_RESPONDER_PH0_RECEIVED_LTK_W4_IRK){ 1405 sm_connection->sm_engine_state = SM_RESPONDER_PH0_SEND_LTK_REQUESTED_NEGATIVE_REPLY; 1406 } | 1336 if (sm_connection->sm_engine_state == SM_RESPONDER_PH1_PAIRING_REQUEST_RECEIVED_W4_IRK){ 1337 sm_connection->sm_engine_state = SM_RESPONDER_PH1_PAIRING_REQUEST_RECEIVED; 1338 break; 1339 } 1340 bool trigger_security_request = sm_connection->sm_pairing_requested || sm_slave_request_security; 1341 sm_connection->sm_pairing_requested = false; 1342#ifdef ENABLE_LE_PROACTIVE_AUTHENTICATION 1343 // trigger security request for Proactive Authentication if LTK available --- 56 unchanged lines hidden (view full) --- 1400 case ADDRESS_RESOLUTION_FAILED: 1401 sm_connection->sm_irk_lookup_state = IRK_LOOKUP_FAILED; 1402 if (IS_RESPONDER(sm_connection->sm_role)) { 1403#ifdef ENABLE_LE_PERIPHERAL 1404 // LTK request received before, IRK required -> negative LTK reply 1405 if (sm_connection->sm_engine_state == SM_RESPONDER_PH0_RECEIVED_LTK_W4_IRK){ 1406 sm_connection->sm_engine_state = SM_RESPONDER_PH0_SEND_LTK_REQUESTED_NEGATIVE_REPLY; 1407 } |
1408 // Pairing request before, continue 1409 if (sm_connection->sm_engine_state == SM_RESPONDER_PH1_PAIRING_REQUEST_RECEIVED_W4_IRK){ 1410 sm_connection->sm_engine_state = SM_RESPONDER_PH1_PAIRING_REQUEST_RECEIVED; 1411 break; 1412 } |
|
1407 // send security request if requested 1408 bool trigger_security_request = sm_connection->sm_pairing_requested || sm_slave_request_security; 1409 sm_connection->sm_pairing_requested = false; 1410 if (trigger_security_request){ 1411 sm_connection->sm_engine_state = SM_RESPONDER_SEND_SECURITY_REQUEST; 1412 sm_pairing_started(sm_connection); 1413 } 1414 break; --- 4185 unchanged lines hidden --- | 1413 // send security request if requested 1414 bool trigger_security_request = sm_connection->sm_pairing_requested || sm_slave_request_security; 1415 sm_connection->sm_pairing_requested = false; 1416 if (trigger_security_request){ 1417 sm_connection->sm_engine_state = SM_RESPONDER_SEND_SECURITY_REQUEST; 1418 sm_pairing_started(sm_connection); 1419 } 1420 break; --- 4185 unchanged lines hidden --- |