System.Bluetooth.TBluetoothGattServer
Delphi
TBluetoothGattServer = class
C++
class PASCALIMPLEMENTATION TBluetoothGattServer : public System::TObject
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | System.Bluetooth.pas System.Bluetooth.hpp |
System.Bluetooth | System.Bluetooth |
Description
GATT server that provides services for Bluetooth Low Energy devices.
To add data to your GATT server, use the following methods:
- AddService, CreateService.
- AddCharacteristic, CreateCharacteristic.
- CreateDescriptor.
- CreateIncludedService.
You may use GattServerName to define the name of your server as well. Otherwise, the name of your server that remote client devices see is "Bluetooth LE Service".
If AdvertiseService is True
(default), services are advertised as you add them to your server. Otherwise, you can call StartAdvertising to start advertising all services in your server.
Use GetServices to obtain the list of services that your GATT server provides or FindService to obtain the instance of a specific service.
Use the following events to track remote client devices that interact with your server:
- OnCharacteristicRead, OnCharacteristicWrite.
- OnConnectedDevice, OnDisconnectDevice.
- OnClientSubscribed, OnClientUnsubscribed.
Once you are running your server, use Close at any time to stop it.
Platform Support
Supported platforms are:
- OS X 10.9+
- iOS 6+
- Android 5+