CGA_Errors
public enum CGA_Errors : Error, Equatable
This enumeration defines a powerful error reporting system for the Bluetooth framework. It conforms to the standard Error
protocol.
-
Simple equatable. We just compare the names, and not the contents.
Declaration
Swift
public static func == (lhs: CGA_Errors, rhs: CGA_Errors) -> Bool
-
This indicates that the Bluetooth system is not available.
Declaration
Swift
case btUnavailable
-
This indicates that the operation was not authenticated/authorized.
Declaration
Swift
case unauthorized
-
This indicates that a connection attempt timed out.
Declaration
Swift
case timeoutError(RVS_BlueThoth.DiscoveryData!)
-
This means that a Peripheral was unexpectedly disconnected.
Declaration
Swift
case unexpectedDisconnection(String!)
-
A generic internal error.
Declaration
Swift
case peripheralError(error: Error!, id: String!)
-
A generic internal error.
Declaration
Swift
case serviceError(error: Error!, id: String!)
-
A generic internal error.
Declaration
Swift
case characteristicError(error: Error!, id: String!)
-
A generic internal error.
Declaration
Swift
case descriptorError(error: Error!, id: String!)
-
A generic internal error.
Declaration
Swift
case internalError(error: Error!, id: String!)
-
Returns a localizable slug for the error. This does not include associated data.
Declaration
Swift
public var localizedDescription: String { get }
-
Returns an Array, with Strings for any nested errors. The last String (position count-1) is the actual Error String, and it applies to the first element (position 1).
Declaration
Swift
public var layeredDescription: [String] { get }
-
This returns any associated data with the current status.
Declaration
Swift
public var associatedData: Any? { get }
-
This returns an internal error, with the Peripheral that reported the error’s ID.
Declaration
Swift
public static func returnNestedInternalErrorBasedOnThis(_ inError: Error?, peripheral inPeripheral: CBPeripheral) -> CGA_Errors
Parameters
inError
The error (which may actually be a nested CGA_Errors.internalError).
peripheral
The CBPeripheral object that is reporting the error.
Return Value
A CGA_Errors.internalError instance, with any nesting added.
-
This returns an internal error, with a nesting of the Bluetooth hierarchy that got us in this mess, and the Service’s ID.
Declaration
Swift
public static func returnNestedInternalErrorBasedOnThis(_ inError: Error?, service inService: CBService) -> CGA_Errors
Parameters
inError
The error (which may actually be a nested CGA_Errors.internalError).
service
The CBService object that is reporting the error.
Return Value
A CGA_Errors.internalError instance, with any nesting added.
-
This returns an internal error, with a nesting of the Bluetooth hierarchy that got us in this mess, and the Characteristic’s ID.
Declaration
Swift
public static func returnNestedInternalErrorBasedOnThis(_ inError: Error?, characteristic inCharacteristic: CBCharacteristic) -> CGA_Errors
Parameters
inError
The error (which may actually be a nested CGA_Errors.internalError).
characteristic
The CBCharacteristic object that is reporting the error.
Return Value
A CGA_Errors.internalError instance, with any nesting added.
-
This returns an internal error, with a nesting of the Bluetooth hierarchy that got us in this mess, and the Descriptor’s ID.
Declaration
Swift
public static func returnNestedInternalErrorBasedOnThis(_ inError: Error?, descriptor inDescriptor: CBDescriptor) -> CGA_Errors
Parameters
inError
The error (which may actually be a nested CGA_Errors.internalError).
descriptor
The CBDescriptor object that is reporting the error.
Return Value
A CGA_Errors.internalError instance, with any nesting added.