5 Profiles for Interoperability
bluetooth-ble
profiles
Key Concepts
- Bluetooth Profile: A standardized specification defining how two or more Bluetooth devices implement a specific use case (e.g., hands-free calling, heart rate monitoring)
- GATT-Based Profile: Modern BLE profile built on the Generic Attribute Profile; defines specific service and characteristic UUIDs, mandatory operations, and data formats
- A2DP (Advanced Audio Distribution Profile): Classic Bluetooth profile for stereo audio streaming; uses ACL connection and SBC/AAC/aptX codecs at up to 328 kbps
- HFP (Hands-Free Profile): Classic Bluetooth profile for phone calls via headsets; requires bidirectional SCO (Synchronous Connection Oriented) audio channel
- Heart Rate Profile (HRP): BLE profile using Heart Rate Service (0x180D) with Heart Rate Measurement characteristic (0x2A37); specifies notification-based operation
- Battery Service (BAS): BLE service (UUID 0x180F) with Battery Level characteristic (0x2A19, 0–100%); universally supported for reporting device charge level
- OTA DFU Profile: Over-the-air firmware update profile (Nordic NRF DFU, TI OAD, Silicon Labs OTA); allows field firmware updates via BLE without physical cable access
- Adopted vs Custom Profile: SIG-adopted profiles use 16-bit UUIDs and guarantee interoperability; custom profiles use 128-bit UUIDs and are vendor-specific
5.1 Learning Objectives
By the end of this chapter, you will be able to:
- Explain the role of Bluetooth profiles in enabling interoperability across devices from different manufacturers
- Implement Serial Port Profile (SPP) for wireless UART communication in embedded systems
- Configure Human Interface Device (HID) profile for keyboards, mice, and game controllers
- Apply Advanced Audio Distribution Profile (A2DP) for high-quality audio streaming with appropriate codec selection
- Select the right profile and justify your choice for different IoT application requirements
Chapter Roadmap
Read this chapter as a profile-selection path:
- First separate Classic, BLE GATT, proximity, and Mesh profile families.
- Then compare SPP, HID, A2DP, AVRCP, and HFP by job and evidence.
- Next use the comparison table and earbud case study to decide when dual-mode support is needed.
- Finally use the worked examples to defend throughput, latency, battery, and compatibility trade-offs.
Checkpoint callouts mark the moments where your design record should be strong enough to move on.
For Beginners: Bluetooth Profiles
Bluetooth profiles define what a device can do – there are profiles for audio streaming, file transfer, heart rate monitoring, and dozens more. Think of profiles as job descriptions: when two devices meet, they check each other’s profiles to see what they have in common, then use the matching profile to communicate.
MVU: Minimum Viable Understanding
If you only have 5 minutes, here’s what you need to know about Bluetooth Profiles:
- Profiles = Interoperability Standards - They define HOW devices communicate for specific use cases (audio, input, data)
- Classic vs BLE Profiles - Audio profiles (A2DP, HFP) use Classic Bluetooth; sensor/health profiles use BLE GATT
- SPP = Wireless Serial Cable - Use Serial Port Profile to replace RS-232 UART connections wirelessly
- HID = Input Devices - Keyboards, mice, and game controllers use Human Interface Device profile
- A2DP = Quality Audio - Advanced Audio Distribution Profile with codecs like SBC, AAC, aptX, LDAC
Bottom line: Choose Classic Bluetooth profiles (A2DP, SPP) for high data rate applications like audio streaming. Choose BLE GATT profiles for low-power sensors, health devices, and smart home applications.
In Plain English
Bluetooth profiles are like standardized recipes that tell devices exactly how to communicate for specific tasks. Without profiles, every Bluetooth headphone manufacturer would invent their own audio format, and your phone wouldn’t be able to play music on any of them.
Why it matters: When you connect a new wireless keyboard to your laptop, it “just works” because both devices speak the same HID profile language. Profiles enable the plug-and-play experience we expect from Bluetooth devices.
Sensor Squad: Bluetooth Walkie-Talkies!
Hey there, future inventors! Let’s learn about Bluetooth profiles with the Sensor Squad!
Meet the Squad:
- Sammy the Sensor - loves measuring things
- Lila the Lightbulb - lights up when she learns something new
- Max the Motor - always moving and doing
- Bella the Battery - keeps track of energy
The Walkie-Talkie Story:
Imagine the Sensor Squad wants to share information, but they each speak different languages!
- Sammy speaks in numbers: “Temperature: 72, Humidity: 45”
- Lila speaks in colors: “Red, Blue, Green!”
- Max speaks in commands: “Go Forward! Turn Left!”
The Problem:
If everyone speaks differently, nobody understands each other! It’s like trying to order pizza in a country where nobody speaks your language.
Bluetooth Profiles to the Rescue!
Profiles are like universal translators:
- A2DP (Audio Profile) = The “Music Language” - Everyone agrees how to share songs
- HID (Input Profile) = The “Button Language” - Everyone agrees how to say “I pressed a button!”
- SPP (Serial Profile) = The “Text Message Language” - Everyone agrees how to send text
Real-World Examples:
- Your wireless earbuds use A2DP to play music
- Your gaming controller uses HID to send button presses
- A smart home sensor uses BLE GATT to report temperature
Fun Experiment: Look at your Bluetooth settings on a phone or computer. You’ll see devices paired for “Audio,” “Input Device,” or “Other” - those are different profiles!
Remember: Profiles make sure ALL Bluetooth devices can be friends and talk to each other!
5.2 Prerequisites
Before diving into this chapter, you should be familiar with:
- Bluetooth Protocol Stack: Understanding of GATT architecture
- Classic Bluetooth vs BLE: Knowing when to use Classic vs BLE
5.3 What Are Bluetooth Profiles?
Bluetooth profiles define how devices should behave for specific use cases. They ensure interoperability between devices from different manufacturers.
Profile Types:
- Audio: A2DP, HFP, HSP, and AVRCP use Classic Bluetooth for continuous audio and call-control streams.
- Input: HID can run over Classic Bluetooth or BLE, depending on latency and battery-life requirements.
- Data: SPP, FTP, and OPP are Classic Bluetooth profiles for file or serial-style data exchange.
- Health: HRS, BLP, and GLS are BLE GATT profiles for structured sensor measurements.
- Proximity: Find Me and Proximity profiles use BLE GATT for nearby-device alerts.
- Automation: Mesh models use BLE Mesh for building-scale control networks.
Checkpoint: Profile Family Map
Before choosing an implementation path, defend these boundaries:
- Classic profiles serve continuous audio, calls, or serial-style streams.
- BLE GATT profiles serve structured services and characteristics.
- BLE Mesh is a building-scale control model, not a replacement for A2DP or SPP.
If the requirement mixes speakers, sensors, and lights, expect a dual-mode radio plus BLE Mesh rather than a single profile.
With that map in place, start with the simplest data profile: SPP behaves like a wireless serial cable, but that convenience comes with Classic Bluetooth power and platform trade-offs.
5.4 Serial Port Profile (SPP)
SPP emulates a serial cable connection, replacing RS-232 with wireless communication.
5.4.1 Architecture
Use Cases:
- Serial debugging
- Sensor data transmission
- Wireless UART for embedded systems
- Legacy device communication
5.4.2 Implementation
SPP uses RFCOMM (Radio Frequency Communication) to create virtual serial ports:
The useful mental model is still a cable replacement, but the review should remember the layers. RFCOMM emulates EIA-232 style control and binary data transport over the Bluetooth baseband through L2CAP, so a terminal sees a simple reliable stream while the controller still handles hopping, framing, retransmission, and link supervision. That makes SPP a good fit for powered debug consoles and legacy UART bridges, but a weak fit for coin-cell sensors that only need occasional structured values.
Android Bluetooth examples use the same role split. A receiver service listens with a BluetoothServerSocket, accepts a connection, then reads framed messages from the resulting BluetoothSocket; a remote app scans or selects the peer, opens its own BluetoothSocket, and writes the command bytes. For an IoT remote-control demo, keep the proof at the application boundary: which button produced which message, how the receiver parsed it, which GPIO or actuator action followed, and what timeout or disconnect rule leaves the device in a known state.
# Python example using PyBluez
import bluetooth
# Server (peripheral device)
server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
server_sock.bind(("", bluetooth.PORT_ANY))
server_sock.listen(1)
# Advertise SPP service
uuid = "00001101-0000-1000-8000-00805F9B34FB" # SPP UUID
bluetooth.advertise_service(server_sock, "SensorData",
service_id=uuid,
service_classes=[uuid, bluetooth.SERIAL_PORT_CLASS],
profiles=[bluetooth.SERIAL_PORT_PROFILE])
print("Waiting for connection...")
client_sock, client_info = server_sock.accept()
print(f"Connected: {client_info}")
# Send/receive data like a serial port
while True:
data = read_sensor()
client_sock.send(f"{data}\n")5.4.3 Arduino Example
#include <SoftwareSerial.h>
// HC-05 Bluetooth module on pins 10, 11
SoftwareSerial bluetooth(10, 11); // RX, TX
void setup() {
Serial.begin(9600);
bluetooth.begin(9600);
Serial.println("Bluetooth SPP Ready");
}
void loop() {
// Send sensor data over Bluetooth
int sensorValue = analogRead(A0);
bluetooth.println(sensorValue);
// Receive commands from phone
if (bluetooth.available()) {
char cmd = bluetooth.read();
processCommand(cmd);
}
delay(100);
}5.4.4 SPP Limitations
- No BLE support: SPP will not work with BLE-only devices; use a BLE UART-style GATT service instead.
- Discovery required: Users normally pair manually; NFC or QR-assisted pairing can reduce setup friction.
- Power consumption: Classic Bluetooth draws more current than BLE; reserve SPP for continuous streams or powered devices.
- No standard data format: SPP transports bytes, not semantics; define a simple application protocol.
Checkpoint: Serial Evidence
At this point, an SPP design needs more than a paired-device screenshot. Record the RFCOMM role, host application, message framing, disconnect behavior, and power fit.
SPP handles bytes; HID handles human input reports. The next section changes the question from “Can I stream data?” to “Can every target operating system interpret this report descriptor correctly?”
5.5 Human Interface Device (HID)
HID profile enables input devices like keyboards, mice, and game controllers.
5.5.1 HID over Classic Bluetooth
Used by most wireless keyboards and mice:
Characteristics:
- Low latency (8-11ms typical)
- Report-based data structure
- Boot protocol for BIOS compatibility
- Encryption required
For a keyboard, the practical path is: key press becomes a HID scan code, the profile wraps it into a report carried by the Bluetooth stack, and the host converts the recovered scan code back into an operating-system input event. That is why HID interoperability depends on the report descriptor and security state, not only on a successful Bluetooth connection.
5.5.2 HID over GATT (BLE)
BLE version for lower power devices:
Service UUID: 0x1812
Characteristics:
- 0x2A4A - HID Information: Read-only metadata about the HID device.
- 0x2A4B - Report Map: Read-only descriptor that tells the host how to interpret reports.
- 0x2A4C - HID Control Point: Write Without Response for suspend/exit-suspend commands.
- 0x2A4D - Report: Read, Write, and Notify for input, output, and feature reports.
- 0x2A4E - Protocol Mode: Read and Write Without Response for Boot vs Report protocol selection.
The Report characteristic (0x2A4D) uses a Client Characteristic Configuration Descriptor (CCCD, UUID 0x2902) — a central writes 0x0001 to this descriptor to enable Input Report notifications from the peripheral.
5.5.3 HID Report Types
- Input reports: Device to host; keystrokes, button presses, mouse movement, joystick axes.
- Output reports: Host to device; LED state such as Caps Lock or controller rumble commands.
- Feature reports: Bidirectional; configuration and device-specific settings.
5.5.4 Example: BLE Keyboard
#include <BleKeyboard.h>
BleKeyboard bleKeyboard("ESP32 Keyboard");
void setup() {
bleKeyboard.begin();
}
void loop() {
if (bleKeyboard.isConnected()) {
// Type a message
bleKeyboard.print("Hello from ESP32!");
// Special keys
bleKeyboard.press(KEY_LEFT_CTRL);
bleKeyboard.press('c');
bleKeyboard.releaseAll();
delay(1000);
}
}5.5.5 Game Controller Support
Modern game controllers use HID:
- Xbox Series controllers: Bluetooth HID, typically around 8 ms.
- PlayStation 5 controllers: Bluetooth HID, typically around 10 ms.
- Nintendo Switch controllers: Bluetooth HID, typically around 15 ms.
Mid-Chapter Check: GATT Fundamentals for BLE Profiles
Before continuing to audio profiles, confirm your understanding of how BLE GATT services operate — the foundation for all BLE-based profiles covered in the rest of this chapter.
5.6 Advanced Audio Distribution Profile (A2DP)
A2DP enables high-quality stereo audio streaming.
5.6.1 Architecture
5.6.2 Audio Codecs
- SBC: 328 kbps, around 200 ms latency, good quality, mandatory and free for A2DP.
- AAC: 256 kbps, around 100 ms latency, very good quality, licensed and widely used by Apple devices.
- aptX: 352 kbps, around 70 ms latency, excellent quality, licensed and useful for video sync.
- aptX HD: 576 kbps, around 100 ms latency, near-CD quality, licensed.
- LDAC: 990 kbps, around 200 ms latency, high-resolution audio, licensed and power-hungry.
- LC3: Variable bitrate, around 20 ms latency, excellent quality, used by BLE Audio rather than classic A2DP.
5.6.3 Codec Selection
During A2DP setup, the source and sink exchange supported codec capabilities and select the best mutually supported option. Always expect fallback to SBC because it is mandatory, then prefer lower-latency codecs when video or gaming sync matters.
5.6.4 A2DP Latency Considerations
Audio latency affects user experience:
- Music listening: Less than 200 ms is usually acceptable; any supported codec can work.
- Video watching: Aim below 100 ms; aptX is preferred, with AAC often acceptable.
- Gaming: Aim below 50 ms; aptX Low Latency is the classic Bluetooth target.
- Live performance: Aim below 20 ms; use wired audio or LE Audio with LC3 rather than classic A2DP.
5.7 Audio/Video Remote Control Profile (AVRCP)
AVRCP provides media playback control alongside A2DP:
Supported Commands:
- Play/Pause/Stop: Control the active media session.
- Next/Previous: Skip between tracks or chapters.
- Fast Forward/Rewind: Move within the current track.
- Volume Up/Down: Adjust playback level from the remote controller.
Metadata (AVRCP 1.3+):
- Track title
- Artist name
- Album name
- Track duration
- Playback position
5.8 Hands-Free Profile (HFP)
HFP enables voice calls through Bluetooth devices:
Features:
- Voice call audio routing
- Call control (answer, reject, hold)
- Voice dialing
- Caller ID display
- Volume control
Use Cases:
- Car hands-free systems
- Bluetooth headsets
- Smart speakers
5.8.1 HFP vs HSP
- Call control: HFP supports full call control; HSP only supports basic headset behavior.
- Voice dial: HFP supports voice dialing; HSP does not.
- Caller ID: HFP can expose caller ID; HSP does not include it.
- Three-way calling: HFP supports it; HSP does not.
- Audio codec: HFP supports CVSD and mSBC; HSP is limited to CVSD.
- Use case: Choose HFP for modern devices and HSP only for legacy compatibility.
5.8.2 Voice Call Audio Quality
Checkpoint: Classic Profile Fit
Before leaving the Classic-profile section, check that the use case matches the profile contract:
- HID proves input compatibility through report descriptors and host interpretation.
- A2DP proves audio streaming through codec negotiation and SBC fallback.
- AVRCP proves media-control behavior alongside A2DP.
- HFP proves call control and bidirectional voice behavior.
If the proof is really a private packet format, it belongs in SPP or custom GATT.
The selection guide now ties those contracts to product requirements. Use it to choose the smallest profile set that satisfies data rate, latency, battery, and interoperability together.
5.9 Technology Comparison
Choosing the right profile for your application:
- Classic Bluetooth: Around 100 m range, 1-3 Mbps data rate, medium power, about 100 ms typical latency, 7 active devices per piconet, pairing-based setup, best for audio and file-style streams.
- BLE: Around 50 m range, 125 kbps to 2 Mbps data rate, very low power, 7.5 ms minimum connection interval, many devices over time, advertising-based discovery, best for sensors.
- BLE Mesh: Multi-hop range, low data rate, low power for relays and sleepy endpoints, variable latency, up to 32,000+ nodes, provisioning-based setup, best for building-wide control.
5.9.1 Profile Selection Guide
- Wireless earbuds: A2DP + AVRCP + HFP for music, media controls, and calls.
- Fitness tracker: BLE HRS + GATT for low-power phone synchronization.
- Game controller: HID over Classic or BLE for low-latency input.
- Smart lock: BLE custom GATT for secure, battery-powered access control.
- Industrial sensor: BLE or Mesh for power-efficient telemetry and site coverage.
- Debug console: SPP for serial-terminal compatibility.
- Car audio: A2DP + HFP for music playback and phone calls.
5.10 Case Study: Wireless Earbuds
Modern wireless earbuds demonstrate multi-profile integration:
Profiles Used:
- A2DP - Stereo music streaming
- AVRCP - Play/pause/skip control
- HFP - Voice calls
- BLE GATT - Battery level, custom settings
Dual-Mode Operation:
Modern earbuds use Classic Bluetooth for A2DP audio streaming and BLE for low-power status updates (battery level, configuration). The dual-mode radio switches between protocols automatically based on the active profile.
Power Optimization:
- A2DP codec selection affects battery life
- BLE for low-power status updates
- Sleep mode when not playing
- Active noise cancellation power budget
Real-World Implementation Tips
For Embedded Developers:
- Start with proven libraries - Use ESP32’s Bluedroid stack or nRF Connect SDK rather than implementing profiles from scratch
- Test on multiple devices - iOS, Android, Windows, and macOS all have subtle profile implementation differences
- Monitor memory usage - Classic Bluetooth profiles require significantly more RAM than BLE
- Handle reconnection gracefully - Users expect paired devices to reconnect automatically
For Product Designers:
- Prioritize profiles - Not all platforms support all profiles equally (iOS limits SPP access)
- Consider companion apps - Custom GATT services require app development; standard profiles work natively
- Plan for certification - Bluetooth SIG qualification is required for commercial products
- Document codec support - Clearly list supported audio codecs (SBC, AAC, aptX, LDAC) in specifications
Checkpoint: Selection Evidence
A profile-selection record should name the device role, selected profile or service, platform risk, and one measurable reason for rejecting close alternatives.
After the selection record, review the failure modes and interactive GATT activities. They turn the profile choice into testable evidence.
Common Pitfalls in Bluetooth Profile Implementation
1. Using Classic Bluetooth for Battery-Powered Sensors
- Mistake: Implementing SPP or A2DP on coin-cell powered devices
- Impact: Battery life measured in hours instead of months
- Solution: Use BLE GATT profiles for battery-critical applications
2. Expecting Low Latency from SBC Codec
- Mistake: Using SBC for gaming or video applications
- Impact: 150-200ms audio delay causes noticeable lip-sync issues
- Solution: Use aptX Low Latency (~40ms) or aptX (~70ms) for time-sensitive audio
3. Implementing Custom Protocols Instead of Standard Profiles
- Mistake: Creating proprietary communication schemes instead of using HID, SPP, or GATT
- Impact: Incompatibility with operating systems and need for custom apps
- Solution: Use standardized profiles whenever possible for plug-and-play compatibility
4. Ignoring Profile Compatibility
- Mistake: Assuming all Bluetooth devices support the same profiles
- Impact: Connection failures between devices (e.g., BLE-only phone can’t use SPP)
- Solution: Check profile support in datasheets; implement dual-mode for maximum compatibility
5. Forgetting About Security Requirements
- Mistake: Implementing HID without encryption on classic Bluetooth
- Impact: Keystroke injection attacks possible
- Solution: HID requires authentication and encryption; always enable security features
Connection: BLE GATT Profiles meet CoAP Resource Model
BLE’s GATT (Generic Attribute Profile) and CoAP share a strikingly similar resource-oriented architecture. Both organize functionality into hierarchical resources: GATT uses Services > Characteristics > Descriptors, while CoAP uses URI paths like /sensors/temperature/current. Both support read/write/notify operations, and both use UUIDs or URIs as resource identifiers. If you understand GATT’s model of exposing sensor data as readable characteristics with notifications on change, you already understand CoAP’s GET with Observe. The key difference: GATT operates at the link layer (single-hop BLE), while CoAP operates at the application layer (multi-hop IP). See CoAP Fundamentals for the CoAP resource model.
5.11 Start With the Story
Two Bluetooth devices can pair and still fail to understand each other. A profile is the shared agreement that says which services exist, what the data means, and how a standard client should behave.
Use this chapter from interoperability backward. Ask what another device must already know, which profile supplies that contract, where a custom service is justified, and how the implementation will prove it did not invent a private dialect by accident.
5.12 Deep Dive: Attribute Tables, Handles, and UUID Evidence
BLE profile conformance is proved by the discovered attribute table, not by a screenshot of one value arriving. The table should show which service owns each characteristic, what access property each value exposes, which descriptor controls notification state, and which parts are standard profile contract versus product-specific semantics.
When a client connects, it performs service discovery by walking the server’s attributes by handle and reading the UUIDs that live at those handles. A standard Heart Rate profile server has an attribute sequence like this:
| Handle | Attribute (UUID) | Evidence meaning |
|---|---|---|
0x0028 |
Primary Service (0x2800) = 0x180D |
Start of the Heart Rate Service |
0x0029 |
Characteristic Declaration (0x2803) |
Declares the measurement: properties = Notify, value at 0x002A |
0x002A |
Heart Rate Measurement (0x2A37) |
Characteristic value that carries the measurement |
0x002B |
CCCD (0x2902) |
Client writes here to enable notifications |
Because this measurement is Notify, the client cannot simply read it once and be done. It must write 0x0001 to the CCCD at handle 0x002B; after that, the server pushes each new reading from the value handle. A good profile test records the UUID discovered, the handle used for the CCCD write, whether the characteristic property is Notify or Indicate, and what happens after reconnect.
The client uses handles as local addresses and UUIDs as meaning. Handles are 16-bit addresses in this server’s attribute table; the same Heart Rate Measurement can sit at handle 0x002A on one device and 0x0015 on another. The UUID 0x2A37, by contrast, is the universal identifier for Heart Rate Measurement. Reusing 16-bit SIG UUIDs for standard data and 128-bit UUIDs for private vendor data keeps generic profile clients interoperable while still leaving space for product-specific features.
Bonded devices may cache handles to avoid rediscovery on every connection, but that cache is conditional evidence, not a portable contract. If firmware changes the attribute database or the server exposes the Service Changed characteristic, the client must invalidate stale handles and rediscover. This is why profile tests should include a reconnect after firmware update or database change: it proves the client relies on UUID meaning and cache invalidation, not on a lucky handle layout from one development board.
5.13 Summary
This chapter covered Bluetooth profiles for different applications:
- SPP enables wireless UART for embedded systems and debugging
- HID provides standardized input device communication (keyboards, mice, controllers)
- A2DP streams high-quality stereo audio with various codecs
- AVRCP adds media playback control to audio streaming
- HFP enables hands-free voice calls for headsets and car systems
- Profile selection depends on data rate, power, latency, and device compatibility
- Modern devices often combine multiple profiles (A2DP + HFP + BLE GATT)
Key Takeaways
- Profiles = Interoperability - They ensure devices from different manufacturers can communicate
- Classic for Streaming - Audio (A2DP) and high-throughput data (SPP) use Classic Bluetooth
- BLE for Battery Life - Sensors, health devices, and beacons use BLE GATT profiles
- Codec Matters - For audio applications, codec choice affects latency and quality (aptX for video sync, LDAC for audiophiles)
- Dual-Mode is Common - Modern devices (earbuds, smart hubs) combine Classic + BLE for best of both worlds
Checkpoint: Deep-Dive Readiness
Before using the worked examples, confirm that the evidence loop is complete: profile family selected, standard UUIDs separated from custom UUIDs, CCCD behavior understood, and platform risks listed.
The remaining sections put numbers behind two common decisions: whether a sensor stream should use SPP or BLE GATT, and how an A2DP codec choice affects battery life and latency.
5.14 Worked Example: SPP Throughput vs BLE GATT for Sensor Data Streaming
Scenario: Compare SPP (Serial Port Profile, Classic Bluetooth) versus BLE GATT for streaming accelerometer data from a motion sensor to a data logger.
Given requirements:
- Accelerometer: 3-axis, 16-bit per axis = 6 bytes per sample
- Sample rate: 100 Hz (100 samples/second for vibration analysis)
- Data rate: 6 bytes × 100 Hz = 600 bytes/second = 4,800 bps
Option 1: Classic Bluetooth SPP
- Protocol: RFCOMM over L2CAP, stream-based like a serial port.
- Typical MTU: 990 bytes, so large packets reduce overhead.
- Practical throughput: 1-2 Mbps, compared with a theoretical 3 Mbps radio rate.
- Latency: 10-50 ms, depending on buffering.
- Active power: 30-50 mA continuously because the connection is maintained.
- Idle power: 5-10 mA with sniff mode around every 40 ms.
Transmission efficiency:
- Samples per packet: 990 bytes ÷ 6 bytes = 165 samples
- Packets per second: 100 samples/sec ÷ 165 = 0.6 packets/sec
- Overhead: RFCOMM (5 bytes) + L2CAP (4 bytes) + Baseband (18 bytes) = 27 bytes
- Efficiency: 990 ÷ (990 + 27) = 97.3%
Battery impact (1000 mAh battery, 8 hours/day use):
- Daily current: 40 mA × 8 hours = 320 mAh
- Battery life: 1000 ÷ 320 = 3.1 days
Option 2: BLE GATT with Notify
- Protocol: ATT over L2CAP, attribute-based rather than stream-based.
- MTU: 23 bytes by default, commonly negotiated to 185 bytes for larger notifications.
- Throughput: 5-10 kbps with the default MTU, limited by connection interval.
- Connection interval: 7.5 ms minimum, allowing up to 133 connection events per second.
- Latency: 7.5-30 ms, often lower than SPP for small updates.
- Active power: 8-12 mA during short radio events.
- Sleep power: 1-3 µA between events.
Transmission with 23-byte MTU (default):
- Payload per notification: 23 - 3 (ATT header) = 20 bytes
- Samples per notification: 20 ÷ 6 = 3 samples (18 bytes, 2 bytes wasted)
- Notifications per second: 100 samples ÷ 3 = 34 notifications/sec
- Problem: With 7.5ms interval, max rate is 133 notifications/sec → feasible
Transmission with 185-byte MTU (negotiated):
- Payload: 185 - 3 = 182 bytes
- Samples per notification: 182 ÷ 6 = 30 samples (180 bytes, 2 wasted)
- Notifications per second: 100 ÷ 30 = 3.3 notifications/sec → easy
Battery impact (185-byte MTU, 7.5ms interval):
- Radio active time: 2 ms per event (TX + RX window)
- Duty cycle: 2ms / 7.5ms = 26.7%
- Average current: 10 mA × 0.267 + 2 µA × 0.733 = 2.67 mA
- Daily use: 2.67 mA × 8 hours = 21.36 mAh
- Battery life: 1000 ÷ 21.36 = 46.8 days
Comparison summary:
- Throughput: Both meet the 4,800 bps requirement, but SPP has much more margin (around 1 Mbps practical vs 10 kbps BLE GATT in this conservative example).
- Latency: BLE wins for small updates at 7.5-30 ms versus 10-50 ms for SPP.
- Battery life: BLE wins strongly: 46.8 days versus 3.1 days.
- Setup complexity: SPP is simpler because it behaves like a serial port; BLE requires GATT service design.
Verdict: For this application (100 Hz streaming), BLE is feasible with large MTU but SPP is the better choice if:
- Mains-powered (battery not a concern) → SPP for simplicity
- Battery-powered with <1 kHz sample rate → BLE with 185-byte MTU
- Battery-powered with >1 kHz sample rate → SPP (BLE bandwidth insufficient)
Real product example: Bosch BNO055 IMU offers both SPP and BLE modes. They recommend SPP for robotics (high-rate control) and BLE for fitness tracking (lower rate, battery critical).
5.15 Putting Numbers to It
Quantifying the battery life difference: SPP vs BLE GATT for 100 Hz accelerometer streaming
Using the worked example data (100 Hz, 6 bytes/sample), calculate the exact battery life impact:
Classic Bluetooth SPP (continuous connection):
Average current during 8 hours/day streaming: I_avg = 40 mA active × 1.0 duty cycle = 40 mA
Daily energy consumption: E_daily = 40 mA × 8 hours = 320 mAh/day
Battery life with 1000 mAh battery: Life_SPP = 1000 mAh / 320 mAh/day = 3.125 days
BLE GATT with 185-byte MTU (CI = 7.5 ms):
Radio duty cycle: 2 ms active every 7.5 ms: Duty = 2 / 7.5 = 0.267 = 26.7%
Average current: I_avg = (10 mA × 0.267) + (2 µA × 0.733) = 2.67 + 0.0015 ≈ 2.67 mA
Daily consumption (8 hours active): E_daily = 2.67 × 8 = 21.36 mAh/day
Battery life: Life_BLE = 1000 / 21.36 = 46.8 days
Battery life improvement: 46.8 / 3.125 = 15.0× longer with BLE
This 15× improvement shows that even for relatively high data rates (100 Hz = 4,800 bps), BLE’s duty-cycled operation provides dramatic power savings compared to SPP’s continuous connection. The key enabler is the 73.3% sleep time (1 - 0.267) between connection events.
5.16 Decision Framework: Choosing A2DP Codec for Wireless Earbuds
- Casual music listening: SBC at 328 kbps, about 200 ms latency, low battery impact, universal compatibility.
- Audiophile music listening: LDAC at 990 kbps, about 200 ms latency, high battery impact, best for hi-res audio or mains-powered products.
- Movie watching: aptX at 352 kbps, about 70 ms latency, medium battery impact, good for lip-sync below the 100 ms threshold.
- Competitive gaming: aptX Low Latency at 352 kbps, about 40 ms latency, medium battery impact, useful when sub-50 ms response matters.
- Phone calls: mSBC through HFP at about 60 kbps and 50 ms latency, low battery impact, optimized for voice rather than music.
- Podcasts and audiobooks: SBC at 328 kbps, about 200 ms latency, low battery impact, best when runtime matters more than audiophile quality.
Codec negotiation flow:
When earbuds connect to a phone, they exchange supported codec lists and select the highest-quality mutually supported codec:
Phone: "I support SBC, AAC, aptX, LDAC"
Earbuds: "I support SBC, AAC, aptX"
Result: Connection uses aptX (highest quality both support)
Real-world trade-off example:
Sony WH-1000XM4 headphones support SBC, AAC, and LDAC:
- With LDAC (990 kbps) on Android: 20 hours battery life
- With SBC (328 kbps) on iPhone: 30 hours battery life
The 10-hour difference (50% more runtime) comes from LDAC’s 3× higher bitrate requiring more radio time and CPU for encoding/decoding.
Decision rule for product designers:
- Always include SBC (mandatory for A2DP certification)
- Add AAC if targeting iOS users (Apple prioritizes AAC > SBC)
- Add aptX if targeting video/gaming use cases (<100ms latency needed)
- Add LDAC only if battery is large or product is mains-powered (audiophile market)
- Skip aptX HD unless targeting niche audiophile market (licensing cost not justified for mass market)
5.17 Putting Numbers to It
How much does codec choice affect wireless earbud battery life?
The Sony WH-1000XM4 battery life difference (20h with LDAC vs 30h with SBC) can be explained by calculating radio airtime:
SBC codec (328 kbps bitrate):
For CD-quality stereo (44.1 kHz, 16-bit), uncompressed rate is: Uncompressed = 44,100 × 16 × 2 = 1,411,200 bps = 1.41 Mbps
SBC compresses to 328 kbps, so Bluetooth must transmit: Radio time per second = 328,000 bits / 3,000,000 bps = 0.109 s = 10.9% duty cycle
Average current (10 mA active, 2 mA idle): I_SBC = (10 × 0.109) + (2 × 0.891) = 1.09 + 1.78 = 2.87 mA
LDAC codec (990 kbps bitrate):
Radio duty cycle: Radio time = 990,000 / 3,000,000 = 0.33 = 33% duty cycle
Average current: I_LDAC = (10 × 0.33) + (2 × 0.67) = 3.3 + 1.34 = 4.64 mA
Battery life ratio (800 mAh battery):
SBC battery life: Life_SBC = 800 / 2.87 = 279 hours ≈ 30 hours claimed
LDAC battery life: Life_LDAC = 800 / 4.64 = 172 hours ≈ 20 hours claimed
Power cost of higher quality: 4.64 / 2.87 = 1.62× more power for LDAC
This 62% power increase for 3× bitrate (990/328 = 3.0×) explains the 33% battery life reduction. For audiophiles, the improved quality justifies the trade-off. For casual listeners or travelers, SBC’s 50% longer runtime is more valuable.
5.18 Common Mistake: Using BLE HID Without Understanding Report Descriptor Complexity
The error: A developer building a custom BLE game controller implements HID over GATT (HOGP) but hardcodes a simple report descriptor, assuming “it’s just button states and joystick positions.”
What actually happens:
HID report descriptors are binary structures that define data layout, units, ranges, and mappings. A minimal game controller descriptor is 60-100 bytes of carefully structured data.
Simplified descriptor structure (actual binary is complex):
Usage Page (Generic Desktop)
Usage (Gamepad)
Collection (Application)
Usage Page (Button)
Usage Minimum (Button 1)
Usage Maximum (Button 12)
Logical Minimum (0)
Logical Maximum (1)
Report Count (12)
Report Size (1)
Input (Data, Variable, Absolute) ← 12 bits for buttons
Report Count (4)
Report Size (1)
Input (Constant) ← 4 bits padding
Usage Page (Generic Desktop)
Usage (X)
Usage (Y)
Logical Minimum (-127)
Logical Maximum (127)
Report Size (8)
Report Count (2)
Input (Data, Variable, Absolute) ← 2 bytes for joystick
End Collection
What the developer got wrong:
They copied a keyboard descriptor and changed “keyboard” to “gamepad” but didn’t update the usage codes. Result:
- Windows recognized the device as a keyboard (not a gamepad)
- Button presses sent as letter keys instead of gamepad buttons
- Joystick axes were interpreted as mouse movements
Debugging nightmare:
- Tested on Android: Worked (Android is lenient with HID descriptors)
- Tested on iOS: Worked (iOS auto-detects based on UUIDs)
- Tested on Windows 10: Failed (strict descriptor parsing)
- Took 3 weeks to debug because Windows HID parser errors are cryptic
The fix:
Use a validated HID descriptor from a reference implementation:
- USB-IF has sample descriptors for game controllers, keyboards, mice
- Nordic Semiconductor’s nRF52 SDK includes working BLE HID examples
- TI’s CC2640 SDK has template descriptors
Production impact:
A Kickstarter-funded BLE game controller (5,000 units manufactured) shipped with a broken HID descriptor. Windows users couldn’t use it. The company had to:
- Release a firmware update (required users to use a smartphone app to reflash)
- Provide full refunds to users who couldn’t update firmware
- Lost an estimated 120,000 USD (refunds + support + reputation damage)
Lesson: HID descriptors are deceptively complex. Always test on all target platforms (Windows, macOS, Linux, Android, iOS) before mass production. Use existing validated descriptors as templates, not keyboard examples copied blindly.
5.19 What’s Next
You have now seen how Bluetooth profiles define interoperability across audio, input, data, and health use cases. The following chapters build on this foundation by putting profiles into practice and extending your understanding to the full BLE stack.
- Bluetooth Hands-On Lab - Build a BLE sensor beacon from scratch using GATT services, notifications, and connection handling in Wokwi.
- BLE GATT Services and Characteristics - Implement standardized GATT services (HRS, BAS, ESS) and design custom service schemas.
- Bluetooth Security - Configure pairing modes, LE Secure Connections, and encryption to protect BLE profile data.
- Classic Bluetooth vs BLE - Compare protocol stacks, power models, and profile availability to justify technology selection.
- Bluetooth Protocol Stack - Analyze the full stack from PHY to ATT/GATT to understand how profiles are built on lower layers.
