# GATT configuration parameters

To configure the GATT server and client functions, use the server, client, and scan parameters.

## GATT server configuration parameters

The two types of server configuration parameters used to [perform Bluetooth Low Energy GATT server functions](https://docs.qualcomm.com/doc/80-70018-13/topic/perform_ble_gatt_server_functions.html#perform-ble-gatt-server-functions) are: advertiser and server parameters. These configuration parameters are managed through `AdvertiserConfigFile.txt` and `ServerConfigFile.txt` files, respectively.

`AdvertiserConfigFile.txt`

The following table lists the possible values of each advertisement parameter in the `AdvertiserConfigFile.txt` file.

| Parameters | Values |
| --- | --- |
| `TxPower` | **Legacy:**<br><br><br><br>> <br>> <br>> <ul class="simple"><br>> <li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: ADVERTISE_TX_POWER_ULTRA_LOW(-21)</p></li><br>> <li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: ADVERTISE_TX_POWER_LOW(-15)</p></li><br>> <li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: ADVERTISE_TX_POWER_MEDIUM(-7)</p></li><br>> <li><p><code class="docutils literal notranslate"><span class="pre">3</span></code>: ADVERTISE_TX_POWER_HIGH(1)</p></li><br>> </ul><br>> <br>> **Extended:**<br>> <br>> <ul class="simple"><br>> <li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: TX_POWER_ULTRA_LOW =-21</p></li><br>> <li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: TX_POWER_LOW =-15</p></li><br>> <li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: TX_POWER_MEDIUM =-7</p></li><br>> <li><p><code class="docutils literal notranslate"><span class="pre">3</span></code>: TX_POWER_HIGH = 1</p></li><br>> </ul> |
| `LegacyFlag` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Use extended advertiser</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Use legacy advertiser</p></li><br></ul> |
| `PeriodicFlag` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Disable periodic advertiser</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Enable periodic advertiser</p></li><br></ul> |
| `ConnectableFlag` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Enable non-connectable advertiser</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Enable connectable advertiser</p></li><br></ul> |
| `ScannableFlag` | <ul><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Enable non-scannable advertiser</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Enable scannable advertiser</p><br><p>This value is applicable only to the extended advertisers. For the legacy advertisers, always set it to <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p><br></li><br></ul> |
| `AnonymousFlag` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Use the advertiser address in all PDUs</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Don’t use the advertiser address in PDUs</p></li><br></ul> |
| `IncludePower` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Don’t include Tx power in the extended header</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Include Tx power in the extended header</p></li><br></ul> |
| `PrimaryPhy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: 1 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">3</span></code>: Low Energy (LE) coded PHY</p></li><br></ul> |
| `SecondaryPhy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: 1 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: 2 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">3</span></code>: LE coded PHY</p></li><br></ul> |
| `Interval` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">160</span></code>: Minimum advertisement interval (100 ms)</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">16777215</span></code>: Maximum advertisement interval (10,485 s)</p></li><br></ul> |
| `TimeOutLegacy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Minimum possible value</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">180000</span></code>: Maximum possible timeout value in ms</p></li><br></ul> |
| `AdvertiseMode` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Low-power mode</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Balanced mode</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Low latency mode (used for legacy)</p></li><br></ul><br><br>The advertisement interval is selected based on the advertiser mode as follows:<br><br><ul class="simple"><br><li><p>Low-power mode: 1 s advertisement interval</p></li><br><li><p>Balanced mode: 250 ms advertisement interval</p></li><br><li><p>Low latency mode: 100 ms advertisement interval</p></li><br></ul> |
| `BLEBtName` | The name to be displayed for that particular advertiser set. |

The following snippet shows an example of an advertisement set:

*******************AdvertisingSet1***************
    TxPower:1
    LegacyFlag:1
    PeriodicFlag:0
    ConnectableFlag:1
    ScannableFlag:1
    AnonymousFlag:0
    IncludePower:1
    PrimaryPhy:1
    SecondaryPhy:1
    Interval: 320
    TimeOutLegacy:0
    AdvertiseMode:1
    BLEBtName:Adv1
    Copy to clipboard

`ServerConfigFile.txt`

The following table lists the possible values of each service parameter in the `ServerConfigFile.txt` file.

| Parameter | Description |
| --- | --- |
| `service uuid` | The service ID. A server can have multiple services. |
| `characteristic uuid` | The ID of the characteristic. A service can have multiple characteristics. A characteristic can have properties and permissions. |
| `characteristic properties` | The properties of the characteristic.<br><br><br><br>> <br>> <br>> Combine the following characteristic properties with a logical OR argument, as required:<br>> <br>> <br>> PROPERTY_BROADCAST = 0x01;<br>>     PROPERTY_READ = 0x02;<br>>     PROPERTY_WRITE_NO_RESPONSE = 0x04;<br>>     PROPERTY_WRITE = 0x08;<br>>     PROPERTY_NOTIFY = 0x10;<br>>     PROPERTY_INDICATE = 0x20;<br>>     PROPERTY_SIGNED_WRITE = 0x40;<br>>     PROPERTY_EXTENDED_PROPS = 0x80;<br>>     Copy to clipboard |
| `characteristic permissions` | The permissions of the characteristic.<br><br><br><br>> <br>> <br>> Combine the following characteristic permissions with a logical OR argument, as required:<br>> <br>> <br>> PERMISSION_READ = 0x01;<br>>     PERMISSION_READ_ENCRYPTED = 0x02;<br>>     PERMISSION_READ_ENCRYPTED_MITM = 0x04;<br>>     PERMISSION_WRITE = 0x10;<br>>     PERMISSION_WRITE_ENCRYPTED = 0x20;<br>>     PERMISSION_WRITE_ENCRYPTED_MITM = 0x40;<br>>     PERMISSION_WRITE_SIGNED = 0x80;<br>>     PERMISSION_WRITE_SIGNED_MITM = 0x100;<br>>     Copy to clipboard |
| `descriptor uuid` | The ID of the descriptor. A characteristic can have multiple descriptors. A descriptor can have permissions. |
| `descriptor permissions` | The permissions of the descriptor. |

The following snippet shows an example of a service in the GATT server.

**************Server1*************
    Service1:[service uuid],[characteristic uuid],[characteristic properties],[characteristic permissions],[descriptor uuid],[descriptor permissions]
    Service1:00001200-0000-1000-8000-00805f9b34fb, 00001101-0000-1000-8000-00805f9b34fb,26,31,00002a06-0000-1000-8000-00805f9b34fb,17
    ManufacturerId:0
    ManufacturerData:AAAA
    **************End of service*************
    Copy to clipboard

## GATT client configuration parameters

The following table lists the connection parameters used to configure the GATT client.

| Parameter | Values | Notes |
| --- | --- | --- |
| `isAuto` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Connects directly</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Connects automatically as soon as a remote device is available</p></li><br></ul> | If this parameter is set to `1`, ensure that the devices are bonded for auto connection. |
| `isOpportunistic` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Connects directly</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Provides the handle if it’s already connected based on the address and transport</p></li><br></ul> | If this parameter is set to `1`, it doesn’t start the connection if it’s not already present. |
| `Tx_Phy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: 1 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: 2 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">4</span></code>: LE coded PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">7</span></code>: All PHYs</p></li><br></ul> | ̶̶ |
| `Rx_Phy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: 1 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: 2 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">4</span></code>: LE coded PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">7</span></code>: All PHYs</p></li><br></ul> | ̶̶ |
| `Phy_Opt:00` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Host preferred coding scheme</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Use S = 2 (500 Kbps) coding scheme</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Use S = 8 (125 Kbps) coding scheme. Use it only when the PHY is LE coded.</p></li><br></ul> | ̶̶ |
| `Mtu_Size` | <ul class="simple"><br><li><p>The minimum value is <code class="docutils literal notranslate"><span class="pre">23</span></code>.</p></li><br><li><p>The maximum value is <code class="docutils literal notranslate"><span class="pre">512</span></code>.</p></li><br></ul> | ̶̶ |

## Scan settings

The following table lists the scan settings used to configure the GATT client.

| Scan types | Values | Notes |
| --- | --- | --- |
| `1: Scan_mode` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">-1</span></code>: Opportunistic mode</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Low-power mode</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Balanced mode</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Low latency mode</p></li><br></ul><br><br>**Regular scan:**<br><br><ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Scan window (512 ms); scan interval (5120 ms)</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Scan window (1024 ms); scan interval (4096 ms)</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Scan window (4096 ms); scan interval (4096 ms)</p></li><br></ul><br><br>**Batch scan:**<br><br><ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Scan window (1500 ms); scan interval (150,000 ms)</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Scan window (1500 ms); scan interval (15,000 ms)</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Scan window (1500 ms); scan interval (5000 ms)</p></li><br></ul> | ̶̶ |
| `2: CallbackType` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Initiates a callback to all the matched advertisements</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Initiates a callback to the first matched advertisement</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">4</span></code>: Initiates a callback when a device detected earlier stops sending advertisements.</p></li><br></ul> | ̶̶ |
| `3: ResultType` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Provides full scan results that have the device, RSSI, advertising data, scan response and, scan timestamps.</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Provides scan results that have the device, RSSI, and scan timestamps.</p></li><br></ul> | ̶̶ |
| `4: ScanPhy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: 1 M-PHY</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">3</span></code>: LE coded PHY. Use it for extended scanning only.</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">255</span></code>: All supported PHYs</p></li><br></ul> | Currently, it’s hard coded to 255 in the application code. |
| `5: Legacy` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">True</span></code>: Legacy scanning</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">False</span></code>: Extended scanning</p></li><br></ul> | ̶̶ |
| `6: ReportDelay` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">0</span></code>: Deliver reports immediately</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">&gt;0</span></code>: Accumulate scan results and deliver them after the delay mentioned (in ms) or if buffers are full (batch scan).</p></li><br></ul> | ̶̶ |
| `7: MatchMode` | <ul><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Aggressive match mode. The hardware finds a match even with feeble signal strength.</p><br><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Sticky match mode. It requires a higher threshold of signal strength.</p><br></li><br></ul> | ̶̶ |
| `8: NumOfAdvMatches` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">1</span></code>: Matches one advertisement per filter</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">2</span></code>: Matches few advertisements according to availability of hardware resources</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">3</span></code>: Matches as many advertisements as the hardware allows</p></li><br></ul> | ̶̶ |

Last Published: Apr 02, 2025

[Previous Topic
Perform Bluetooth Low Energy GATT client functions](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/perform_ble_gatt_client_functions.md) [Next Topic
Advanced Audio Distribution Profile](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/set-up-a2dp.md)