Instance Method

add(_:)

Publishes a service and any of its associated characteristics and characteristic descriptors to the local GATT database.

Declaration

func add(_ service: CBMutableService)

Parameters

service

The service you want to publish.

Discussion

When you add a service to the database, the peripheral manager calls the peripheralManager(_:didAdd:error:) method of its delegate object. If the service contains any included services, you must publish them first.

See Also

Adding and Removing Services

func remove(CBMutableService)

Removes a specified published service from the local GATT database.

func removeAllServices()

Removes all published services from the local GATT database.