GATT Service

<\/script>\n
'; }, get iframeSnippet() { const domain = '{ SITE_DOMAIN }'; const type = '{ embed_type }'; const slug = '{ embed_slug }'; return ''; }, get activeSnippet() { return this.method === 'script' ? this.scriptSnippet : this.iframeSnippet; }, copySnippet() { navigator.clipboard.writeText(this.activeSnippet).then(() => { this.copied = true; setTimeout(() => { this.copied = false; }, 2000); }); } }" @keydown.escape.window="open = false" @click.outside="open = false">

Embed This Widget

Theme


      
    

Widget powered by . Free, no account required.

A collection of related characteristics and behaviors defined by a UUID (e.g. Heart Rate Service 0x180D).

Also known as: Service BLE Service

What Is a GATT Service?

A ATT">gatt-service/" class="glossary-term-link" data-term="GATT Service" data-definition="Collection of related BLE characteristics." data-category="GATT & ATT">GATT Service is a logical container that groups related characteristics and behaviors into a single discoverable unit within a BLE device's attribute database. Every piece of data a BLE device exposes -- whether it is a temperature reading, battery level, or firmware revision -- lives inside a service.

Service Identification

Each service is identified by a UUID. The Bluetooth SIG has reserved 16-bit UUIDs for commonly standardized services. For example:

16-bit UUID Service Name
0x180D Heart Rate
0x180F Battery Service
0x1800 Generic Access
0x1801 Generic Attribute
0x180A Device Information

Custom or vendor-specific services use 128-bit UUIDs. A widely adopted convention is to use a base UUID with a unique 32-bit prefix, although any random 128-bit value is valid as long as it does not collide with the SIG base UUID range.

Primary vs. Secondary Services

The GATT specification distinguishes two service types. Primary Services are directly discoverable by clients during service discovery. Secondary Services are helper services referenced only by other services through an Include declaration. In practice, the vast majority of implementations use primary services exclusively; secondary services appear mainly in complex profiles such as the Glucose Profile.

Service Structure in the Attribute Database

Within the ATT database, a service declaration is an attribute with the type UUID 0x2800 (Primary Service) or 0x2801 (Secondary Service). Its value field contains the service UUID. All attributes that follow -- up to the next service declaration or end of the database -- belong to that service. This sequential layout means the handle range implicitly defines service boundaries.

Design Best Practices

When designing a custom GATT server, keep services focused on a single functional domain. Avoid monolithic services that bundle unrelated data because clients must discover the entire service even if they need only one characteristic. Splitting data into smaller services improves discoverability and allows clients on memory-constrained SoCs to cache only what they need. The Device Information Service (0x180A) should always be included because many mobile operating systems query it during connection setup.

Related Terms

Frequently Asked Questions

Our glossary covers 90+ BLE technical terms organized by category. Each term includes a definition, related terms, and links to relevant chips and guides.