diff --git a/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt b/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt index 6c20636..dfd5f61 100644 --- a/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt +++ b/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt @@ -308,6 +308,7 @@ class BleManager private constructor(private val context: Context) { onReconnectionFailed?.invoke() return } + // Stop any active reconnect scan first reconnectScanCallback?.let { cb -> @@ -835,6 +836,13 @@ class BleManager private constructor(private val context: Context) { if (status == BluetoothGatt.GATT_SUCCESS) { if (txCharacteristic != null && rxCharacteristic != null) { isServiceReady.value = true + // Connection priority HIGH 요청: peripheral이 수락하면 interval ~15ms로 협상되어 + // Central Link Layer ACK 속도 ↑ → FW SoftDevice TX queue 포화 빈도 ↓ + val priorityOk = try { + gatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH) + } catch (_: Exception) { false } + logd { "requestConnectionPriority(HIGH) → $priorityOk" } + debugLogger.info("CONN_PRIORITY HIGH requested (ok=$priorityOk)") com.example.medilightv2android.services.AdcCsvLogger.newSession() com.example.medilightv2android.services.BleForegroundService.start(context) startBatteryPolling()