Skip to content

Commit e3981ba

Browse files
committed
OCP.1: allow for OCP.1 protocol versions greater than 1
AES70-3-2024 says that the OCP.1 protocol version should always be 1, but some clients send higher versions (presumably to match the AES70 revision). accept those; we will need to use different heuristics if the actual wire protocol changes.
1 parent f46735d commit e3981ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/SwiftOCA/OCF/Messages/Header.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ public struct Ocp1Header: Codable, Sendable, _Ocp1Codable {
5050
OcaUint16(bigEndian: $0.loadUnaligned(fromByteOffset: 0, as: OcaUint16.self))
5151
}
5252

53-
guard protocolVersion == Ocp1ProtocolVersion else {
53+
// AES70-3-2024 says that the OCP.1 protocol version should always be 1,
54+
// but some clients send higher versions (presumably to match the AES70
55+
// revision). accept those; we will need to use different heuristics if the
56+
// actual wire protocol changes.
57+
guard protocolVersion >= Ocp1ProtocolVersion else {
5458
throw Ocp1Error.invalidProtocolVersion
5559
}
5660

0 commit comments

Comments
 (0)