PureSwift / GATT

Bluetooth Generic Attribute Profile (GATT) for Swift (Supports Linux)
MIT License
63 stars 18 forks source link

Advertise registered services in GATTPeripheral #27

Closed fwcd closed 3 years ago

fwcd commented 3 years ago

Issue

Fixes #26.

What does this PR Do?

It configures the advertisement data payload to include the registered service UUIDs before starting to advertise over BLE.

Where should the reviewer start?

GATTPeripheral.swift

colemancda commented 3 years ago

The problems with this is that you only have 31 bytes (61 with Scan Response) to advertise services. If you are using 128 bit UUID you could use that up really fast. Also, what about manufacturer data or local name advertisement? That is why we leave it up to you to customize the advertising. This is a feature not a bug.

fwcd commented 3 years ago

Perhaps the GATTPeripheral could offer a method to customize the advertised services as an abstraction over the raw controller?

colemancda commented 3 years ago

You could build that as an extension if you want to.