Open
Description
It would be good to make McuMgrTransportError
conform to equatable, so developers can easily test if certain errors are occurring and act accordingly. We added an extension in our app to do this, but others may have the same need so it would be good if it was apart of the standard framework. See code below.
extension McuMgrTransportError: Equatable {
public static func == (lhs: McuMgrTransportError, rhs: McuMgrTransportError) -> Bool {
switch (lhs, rhs) {
case (.connectionTimeout, .connectionTimeout): return true
case (.connectionFailed, .connectionFailed): return true
case (.disconnected, .disconnected): return true
case (.sendTimeout, .sendTimeout): return true
case (.sendFailed, .sendFailed): return true
case let (.insufficientMtu(lhsMTU), .insufficientMtu(rhsMTU)): return lhsMTU == rhsMTU
case (.badResponse, .badResponse): return true
default: return false
}
}
}
Metadata
Metadata
Assignees
Labels
No labels