GATT
Bluetooth Generic Attribute Profile (GATT) for Swift
import GATT
Module information
- Declarations
- 223
- Symbols
- 286
Overview
The Generic Attributes (GATT) is the name of the interface used to connect to Bluetooth LE devices. The interface has one or more Bluetooth Services, identified by unique ids, that contain Bluetooth Characteristics also identified by ids.
Central
The GATT client or central sends requests to a server and receives responses (and server-initiated updates) from it. The GATT client does not know anything in advance about the server’s attributes, so it must first inquire about the presence and nature of those attributes by performing service discovery. After completing service discovery, it can then start reading and writing attributes found in the server, as well as receiving server-initiated updates.
protocol CentralManager
GATT Central Manager
class GATTCentral<HostController, Socket>
struct GATTCentralOptions
enum CentralError
Errors for GATT Central Manager
struct Peripheral
Peripheral Peer
struct AsyncCentralScan<Central>
struct AsyncCentralNotifications<Central>
struct ScanData<Peripheral, Advertisement>
The data for a scan result.
protocol AdvertisementData
GATT Advertisement Data.
typealias ManufacturerSpecificData
struct Service<Peripheral, ID>
struct Characteristic<Peripheral, ID>
CharacteristicProperty
struct Descriptor<Peripheral, ID>
AttributePermission
Peripheral
The GATT server or peripheral receives requests from a client and sends responses back. It also sends server-initiated updates when configured to do so, and it is the role responsible for storing and making the user data available to the client, organized in attributes.
protocol PeripheralManager
GATT Peripheral Manager
class GATTPeripheral<HostController, Socket>
GATT Peripheral Manager
struct GATTPeripheralOptions
struct Central
Central Peer
struct GATTReadRequest<Central, Data>
struct GATTWriteRequest<Central, Data>
struct GATTWriteConfirmation<Central, Data>