Bluetooth GATT Attribute Reference
Secondary Service (0x2801)
Secondary Service is defined in the Bluetooth GATT XML specification with type org.bluetooth.attribute.gatt.secondary_service_declaration and UUID 0x2801.
Quick Summary
Payload length ranges from 2 to 16 bytes depending on UUID width or variable fields. This page is generated from official GATT XML and presented as implementation-ready guidance.
At a Glance
Key reference details for BLE implementation, interoperability testing, and AI-assisted troubleshooting.
| Property | Value |
|---|---|
| Name | Secondary Service |
| UUID | 0x2801 |
| Type | org.bluetooth.attribute.gatt.secondary_service_declaration |
| XML Root | Attribute |
| Source File | org.bluetooth.attribute.gatt.secondary_service_declaration.xml |
| Field Count | 1 |
Field Specification
Parsed field definitions from the source XML value structure.
| Field | Requirement | Format | Unit | Exponent | Notes |
|---|---|---|---|---|---|
| UUID | Mandatory | gatt_uuid | - | - | - |
Byte Layout and Decode
Payload length ranges from 2 to 16 bytes depending on UUID width or variable fields.
function decodePayload(dataView, offset = 0) {
const uuidRaw = new Uint8Array(dataView.buffer, dataView.byteOffset + offset + 0);
const uuid = uuidRaw.length === 2
? `0x${uuidRaw[0].toString(16).padStart(2, "0")}${uuidRaw[1].toString(16).padStart(2, "0")}`
: Array.from(uuidRaw).map((b) => b.toString(16).padStart(2, "0")).join("");
// UUID width can be 2 bytes (16-bit) or 16 bytes (128-bit).
return { uuid };
}
Use Cases and Integration Notes
GATT Table Parsing
Interpret declaration attributes to build reliable handles and operation maps in clients.
Code Generation
Use attribute metadata to auto-generate strongly-typed BLE client APIs.
Firmware QA
Check declaration consistency against actual values to catch table defects early.
Implementation Checklist
- Parse attribute fields strictly in declared order and format.
- Treat handles and value references as separate entities where required.
- Guard for variable-width UUID formats in mixed 16-bit and 128-bit profiles.
- Log parsed attribute metadata for post-run debugging and audits.
FAQ
What is Secondary Service in Bluetooth GATT?
Secondary Service is defined as a Bluetooth GATT attribute entry with type org.bluetooth.attribute.gatt.secondary_service_declaration and UUID 0x2801.
What UUID identifies Secondary Service?
The UUID for Secondary Service is 0x2801.
How should I parse Secondary Service?
Payload length ranges from 2 to 16 bytes depending on UUID width or variable fields.
Where does this definition come from?
This page is generated from the Bluetooth SIG mirror XML in the oesmith/gatt-xml repository.
How does this page support BLE implementation?
The page combines structured tables, practical Q&A, and JSON-LD metadata to help teams validate integrations and troubleshoot consistently.