ServiceIdentifier

public protocol ServiceIdentifier

ServiceIdentifier protocol specifies how information about services of device should look like. Sample implementation could look like:

enum DeviceService: String, ServiceIdentifier {
    case deviceInformation = "180A"
    var uuid: CBUUID {
        return CBUUID(string: self.rawValue)
    }
}

After implementing this and other protocol `CharacteristicIdentifier, you could call methods even easier thanks to convenience methods in library. This methods do all of the heavy lifting like discovering services, taking them from cache etc. for you. We really recommend you to use it.

  • Unique identifier of a service.

    Declaration

    Swift

    var uuid: CBUUID { get }