@@ -21,7 +21,8 @@ extension CBATTError: Hashable, Identifiable {
2121 public var id : Self { self }
2222}
2323
24- public enum BLEError : Error , Hashable , Identifiable , CustomStringConvertible {
24+ public enum BLEError : Error , CustomStringConvertible {
25+
2526 public enum CoreBluetoothError : Error , Hashable , Identifiable , CustomStringConvertible {
2627 case base( code: CBError . Code , description: String ) , ATT( code: CBATTError . Code , description: String ) , other( error: NSError )
2728
@@ -97,6 +98,14 @@ public enum BLEError: Error, Hashable, Identifiable, CustomStringConvertible {
9798
9899 public var id : Self { self }
99100
101+ case advertisingInProgress
102+
103+ case advertisingStartFailed( Error )
104+
105+ case addingServiceFailed( CBMutableService , Error )
106+
107+ case publishingL2CAPChannelFailed( CBL2CAPPSM , Error )
108+
100109 /// Generic error for handling `unknown` cases.
101110 case unknown
102111
@@ -117,6 +126,10 @@ public enum BLEError: Error, Hashable, Identifiable, CustomStringConvertible {
117126
118127 public var description : String {
119128 switch ( self ) {
129+ case . advertisingInProgress: return " Advertising in Progress "
130+ case . advertisingStartFailed( let error) : return " Advertising failed to start with error: \( error) "
131+ case . addingServiceFailed( let service, let error) : return " Adding service \( service) failed with error: \( error) "
132+ case . publishingL2CAPChannelFailed( _, let error) : return " Publishing L2CAPChannel failed with error: \( error) "
120133 case . unknown: return " Unknown error "
121134 case . deallocated: return " Deallocated "
122135 case . managerState( let error) : return " Manager state error: \( error) "
0 commit comments