| Start |
|---|
| Finding BLE Devices The following permissions are required to use the Bluetooth APIs: The |
| Connecting to a GATT Server Once you have discovered a desired BluetoothDevice object, you can connect to it by using its Override |
| Writing and Reading from Characteristics Once you are connected to a Gatt Server, you're going to be interacting with it by writing and reading from the server's characteristics. To do this, first you have to discover what services are available on this server and which characteristics are avaiable in each service: A basic write operation goes like this: When the write process has finished, the A basic write operation goes like this: When the write process has finished, the |
| Subscribing to Notifications from the Gatt Server You can request to be notified from the Gatt Server when the value of a characteristic has been changed: All notifications from the server will be received in the |
| Advertising a BLE Device You can use Bluetooth LE Advertising to broadcast data packages to all nearby devices without having to establish a connection first. Bear in mind that there's a strict limit of 31 bytes of advertisement data. Advertising your device is also the first step towards letting other users connect to you. Since not all devices support Bluetooth LE Advertising, the first step is to check that your device has all the necessary requirements to support it. Afterwards, you can initialize a |
| Using a Gatt Server In order for your device to act as a peripheral, first you need to open a This is an example of a BluetoothGattCharacteristic with full write,read and notify permissions. According to your needs, you might want to fine tune the permissions that you grant this characteristic: The Whenever you receive a request for a write/read to a characteristic or descriptor you must send a response to it in order for the request to be completed succesfully : |
Read Article
https://develop.horje.com/learn/1434/reference