코드 정리
- 주석 영문으로 변경 - Allman 스타일로 통일
This commit is contained in:
@@ -100,7 +100,7 @@ void ble_security_quick_pm_handler(pm_evt_t const *p_evt)
|
||||
{
|
||||
ret_code_t err_code;
|
||||
|
||||
// DEV 모드: 보안 실패 이벤트는 SDK 핸들러에 전달하지 않음 (disconnect 방지)
|
||||
// DEV mode: do not forward security failure events to SDK handler (prevent disconnect)
|
||||
if (m_state.dev_mode && p_evt->evt_id == PM_EVT_CONN_SEC_FAILED) {
|
||||
DBG_PRINTF("Security failed: error=%d\r\n",
|
||||
p_evt->params.conn_sec_failed.error);
|
||||
@@ -133,13 +133,13 @@ void ble_security_quick_pm_handler(pm_evt_t const *p_evt)
|
||||
p_evt->params.conn_sec_failed.error);
|
||||
|
||||
if (m_state.dev_mode) {
|
||||
// DEV 모드: 보안 실패 무시 — 연결 유지
|
||||
// DEV mode: ignore security failure, keep connection
|
||||
DBG_PRINTF("DEV: Ignoring sec failure, keeping connection\r\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (p_evt->params.conn_sec_failed.error == PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING) {
|
||||
// Key missing: 재페어링 시도, 실패 시 disconnect로 폴백
|
||||
// Key missing: attempt re-pairing, fall back to disconnect on failure
|
||||
err_code = pm_conn_secure(p_evt->conn_handle, true);
|
||||
if (err_code != NRF_ERROR_INVALID_STATE &&
|
||||
err_code != NRF_ERROR_BUSY &&
|
||||
@@ -147,11 +147,11 @@ void ble_security_quick_pm_handler(pm_evt_t const *p_evt)
|
||||
APP_ERROR_CHECK(err_code);
|
||||
}
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
// 재페어링 불가 → disconnect
|
||||
// Re-pairing not possible -> disconnect
|
||||
pm_handler_disconnect_on_sec_failure(p_evt);
|
||||
}
|
||||
} else {
|
||||
// 기타 보안 실패 → bond 삭제 후 재페어링 시도
|
||||
// Other security failure -> delete bond then attempt re-pairing
|
||||
pm_peer_id_t peer_id;
|
||||
if (pm_peer_id_get(p_evt->conn_handle, &peer_id) == NRF_SUCCESS
|
||||
&& peer_id != PM_PEER_ID_INVALID) {
|
||||
|
||||
Reference in New Issue
Block a user