VelocAI logo Bluetooth Explorer Documentation

Bluetooth GATT Attribute Reference

Primary Service (0x2800)

org.bluetooth.attribute.gatt.primary_service_declaration

Primary Service is defined in the Bluetooth GATT XML specification with type org.bluetooth.attribute.gatt.primary_service_declaration and UUID 0x2800.

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.

PropertyValue
NamePrimary Service
UUID0x2800
Typeorg.bluetooth.attribute.gatt.primary_service_declaration
XML RootAttribute
Source Fileorg.bluetooth.attribute.gatt.primary_service_declaration.xml
Field Count1

Field Specification

Parsed field definitions from the source XML value structure.

Field Requirement Format Unit Exponent Notes
UUIDMandatorygatt_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 Primary Service in Bluetooth GATT?

Primary Service is defined as a Bluetooth GATT attribute entry with type org.bluetooth.attribute.gatt.primary_service_declaration and UUID 0x2800.

What UUID identifies Primary Service?

The UUID for Primary Service is 0x2800.

How should I parse Primary 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.