Structure

CBAttributePermissions

Values representing the read, write, and encryption permissions for a characteristic’s value.

Overview

When you initialize a new mutable characteristic, you set the read, write, and encryption permissions for the characteristic’s value. Setting the read and write permissions for a characteristic’s value is different from specifying the read and write properties for a characteristic’s value. Specifying the read and write properties for a characteristic’s value lets the client (a central) know what read and write permissions of the characteristic’s value are set. Specifying the read and write permissions for a characteristic’s value actually sets the permissions for the server (the peripheral) to allow the type of read or write specified by the characteristic’s properties. Therefore, if you specify read or write properties when initializing a mutable characteristic, you must also specify corresponding read or write permissions for that characteristic. If you want to enforce encryption requirements for reads and writes on a characteristic’s value, you must do so by specifying the relevant permission (readEncryptionRequired or writeEncryptionRequired). You may set more than one permission for a characteristic’s value.

Topics

Constants

static var readable: CBAttributePermissions

The characteristic’s value has read-only permission.

static var writeable: CBAttributePermissions

The characteristic’s value has write-only permission.

static var readEncryptionRequired: CBAttributePermissions

The characteristic’s value is readable only by trusted devices.

static var writeEncryptionRequired: CBAttributePermissions

The characteristic’s value is writeable only by trusted devices.

Relationships

Conforms To