Service

public class Service

Service is a class implementing ReactiveX which wraps CoreBluetooth functions related to interaction with CBService

  • Intance of CoreBluetooth service class

    Declaration

    Swift

    public let service: CBService
  • Peripheral to which this service belongs

    Declaration

    Swift

    public let peripheral: Peripheral
  • True if service is primary service

    Declaration

    Swift

    public var isPrimary: Bool
  • Service’s UUID

    Declaration

    Swift

    public var uuid: CBUUID
  • Service’s included services

    Declaration

    Swift

    public var includedServices: [Service]?
  • Service’s characteristics

    Declaration

    Swift

    public var characteristics: [Characteristic]?
  • Function that triggers characteristics discovery for specified Services and identifiers. Discovery is called after subscribtion to Observable is made.

    Declaration

    Swift

    public func discoverCharacteristics(_ characteristicUUIDs: [CBUUID]?) -> Single<[Characteristic]>

    Parameters

    identifiers

    Identifiers of characteristics that should be discovered. If nil - all of the characteristics will be discovered. If you’ll pass empty array - none of them will be discovered.

    Return Value

    Single that emits next with array of Characteristic instances, once they’re discovered. If not all requested characteristics are discovered, RxError.noElements error is emmited.

  • Undocumented

    Declaration

    Swift

    public func discoverIncludedServices(_ includedServiceUUIDs: [CBUUID]?) -> Single<[Service]>