From 618e9ed4c8c73d68cf322bbd35c9c945a76974c5 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 3 Apr 2026 02:27:43 -0700 Subject: [PATCH] iOS: parse and discard RSP_KEEPALIVE messages --- cue-ios/CueIOS/AppState.swift | 3 +++ cue-ios/CueIOS/Models/Protocol.swift | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/cue-ios/CueIOS/AppState.swift b/cue-ios/CueIOS/AppState.swift index e3243e2..f431e73 100644 --- a/cue-ios/CueIOS/AppState.swift +++ b/cue-ios/CueIOS/AppState.swift @@ -251,6 +251,9 @@ final class AppState { case .cellK(let k): calCellConstant = Double(k) status = String(format: "Device cell constant: %.4f cm\u{207B}\u{00B9}", k) + + case .keepalive: + break } } diff --git a/cue-ios/CueIOS/Models/Protocol.swift b/cue-ios/CueIOS/Models/Protocol.swift index a0702f3..47bb394 100644 --- a/cue-ios/CueIOS/Models/Protocol.swift +++ b/cue-ios/CueIOS/Models/Protocol.swift @@ -29,6 +29,7 @@ let RSP_REF_FRAME: UInt8 = 0x20 let RSP_REF_LP_RANGE: UInt8 = 0x21 let RSP_REFS_DONE: UInt8 = 0x22 let RSP_REF_STATUS: UInt8 = 0x23 +let RSP_KEEPALIVE: UInt8 = 0x50 // Cue -> ESP32 let CMD_SET_SWEEP: UInt8 = 0x10 @@ -123,6 +124,7 @@ enum EisMessage { case refsDone case refStatus(hasRefs: Bool) case cellK(Float) + case keepalive } // MARK: - Response parser @@ -254,6 +256,9 @@ func parseSysex(_ data: [UInt8]) -> EisMessage? { case RSP_CELL_K where p.count >= 5: return .cellK(decodeFloat(p, at: 0)) + case RSP_KEEPALIVE: + return .keepalive + default: return nil }