iOS: parse and discard RSP_KEEPALIVE messages
This commit is contained in:
parent
d409f3569e
commit
618e9ed4c8
|
|
@ -251,6 +251,9 @@ final class AppState {
|
||||||
case .cellK(let k):
|
case .cellK(let k):
|
||||||
calCellConstant = Double(k)
|
calCellConstant = Double(k)
|
||||||
status = String(format: "Device cell constant: %.4f cm\u{207B}\u{00B9}", k)
|
status = String(format: "Device cell constant: %.4f cm\u{207B}\u{00B9}", k)
|
||||||
|
|
||||||
|
case .keepalive:
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ let RSP_REF_FRAME: UInt8 = 0x20
|
||||||
let RSP_REF_LP_RANGE: UInt8 = 0x21
|
let RSP_REF_LP_RANGE: UInt8 = 0x21
|
||||||
let RSP_REFS_DONE: UInt8 = 0x22
|
let RSP_REFS_DONE: UInt8 = 0x22
|
||||||
let RSP_REF_STATUS: UInt8 = 0x23
|
let RSP_REF_STATUS: UInt8 = 0x23
|
||||||
|
let RSP_KEEPALIVE: UInt8 = 0x50
|
||||||
|
|
||||||
// Cue -> ESP32
|
// Cue -> ESP32
|
||||||
let CMD_SET_SWEEP: UInt8 = 0x10
|
let CMD_SET_SWEEP: UInt8 = 0x10
|
||||||
|
|
@ -123,6 +124,7 @@ enum EisMessage {
|
||||||
case refsDone
|
case refsDone
|
||||||
case refStatus(hasRefs: Bool)
|
case refStatus(hasRefs: Bool)
|
||||||
case cellK(Float)
|
case cellK(Float)
|
||||||
|
case keepalive
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Response parser
|
// MARK: - Response parser
|
||||||
|
|
@ -254,6 +256,9 @@ func parseSysex(_ data: [UInt8]) -> EisMessage? {
|
||||||
case RSP_CELL_K where p.count >= 5:
|
case RSP_CELL_K where p.count >= 5:
|
||||||
return .cellK(decodeFloat(p, at: 0))
|
return .cellK(decodeFloat(p, at: 0))
|
||||||
|
|
||||||
|
case RSP_KEEPALIVE:
|
||||||
|
return .keepalive
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue