From c86be4112c29671694873a8a97811e2e08f31a5f Mon Sep 17 00:00:00 2001 From: jhchun Date: Tue, 19 May 2026 16:30:10 +0900 Subject: [PATCH] =?UTF-8?q?BLE=20=ED=8C=A8=EC=8A=A4=ED=82=A4=20=EC=9D=B8?= =?UTF-8?q?=EC=A6=9D=20=EC=A0=84=20NUS=20=EB=AA=85=EB=A0=B9=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=20=EB=B0=A9=EC=A7=80=20-=20=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EB=B2=84=20=EB=B3=B4=EC=95=88=20=EB=8C=80=EC=9D=91(2=EC=B0=A8?= =?UTF-8?q?=20NUS=20RX=20=EC=B0=A8=EB=8B=A8,=20FW=20=ED=95=B8=EB=93=A4?= =?UTF-8?q?=EB=9F=AC=20=EC=8B=A4=ED=96=89=20=EB=B0=A9=EC=A7=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 패스키로 인증되지 않은 경우 명령 버퍼에 복사하지 않고 return - 파서, 측정 등 진행 X - 연결 끊김 이벤트 시 명령 버퍼 초기화 - 개발 모드(BLE_DEV_MODE=1)인 경우 미적용 --- project/ble_peripheral/ble_app_bladder_patch/main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/project/ble_peripheral/ble_app_bladder_patch/main.c b/project/ble_peripheral/ble_app_bladder_patch/main.c index 9976f18..2beed84 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/main.c +++ b/project/ble_peripheral/ble_app_bladder_patch/main.c @@ -616,9 +616,6 @@ static void nus_data_handler(ble_nus_evt_t * p_evt) { if (p_evt->type == BLE_NUS_EVT_RX_DATA) { - cmd_type_t = CMD_BLE; - ble_got_new_data = true; - /* Central may have increased connection interval; re-request fast interval (once per 30s) */ { static uint32_t last_update_tick = 0; @@ -1070,6 +1067,7 @@ static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) disc_reason, unintended_disc ? " [UNINTENDED]" : ""); ble_connection_st = 0; + pending_cmd_len = 0; // Clear pending command buffer m_conn_handle = BLE_CONN_HANDLE_INVALID; m_tx_in_progress = false; @@ -1100,12 +1098,13 @@ static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) case BLE_GAP_EVT_CONNECTED: DBG_PRINTF("[BLE] Connected\r\n"); - -#if FEATURE_SECURE_CONNECTION - ble_connection_st = 1; + +#if BLE_DEV_MODE + /* Dev: no passkey/SEC — allow NUS TX/RX as soon as GAP is up (prod uses PM_EVT_CONN_SEC_SUCCEEDED). */ + ble_connection_st = BLE_CONNECTED_ST; battery_timer_start(); #endif - + m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle; err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle); APP_ERROR_CHECK(err_code);