Bluetooth & BLE · Study deck

Bluetooth Profiles: Selection and Implementation

The profile families are understood, but a product still needs one interoperable choice.

Radio Remi is your guide for this deck.

profiles
Radio Remi, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: Battery life ratio (800 mAh battery):: SBC battery life: Life_SBC = 800 / 2.87 = 279 hours (radio-only estimate; Sony's rated 30 hours also includes DAC, amplifier, and ANC current that this model doesn't capture).
  • Explain: 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.".
  • Explain: 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.
iotclass.org

Major section

Technology Comparison

Mesh remains a separate many-node control choice.

  • The comparison guides selection; its example ranges and rates still require device and site measurement rather than being treated as acceptance guarantees.
  • Wireless earbuds: A2DP + AVRCP + HFP for music, media controls, and calls.
Bluetooth Technology Comparison: Classic vs BLE GATT
Bluetooth Technology Comparison: Classic vs BLE GATT
iotclass.org

Major section

Common Pitfalls in Bluetooth Profile Implementation

Solution: HID requires authentication and encryption; always enable security features.

  • Impact: 150-200 ms audio delay causes noticeable lip-sync issues.
  • Impact: Incompatibility with operating systems and need for custom apps.
  • Mistake: Assuming all Bluetooth devices support the same profiles.
  • Impact: Connection failures between devices (e.g., BLE-only phone can't use SPP).

Numbers to remember

150-200 msImpact: 150-200 ms audio delay causes noticeable lip-sync issues.
iotclass.org

Major section

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.
  • The key difference: GATT operates at the link layer (single-hop BLE), while CoAP operates at the application layer (multi-hop IP).
iotclass.org

Major section

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 expose access properties, notification descriptors, and the boundary between a standard profile and product-specific semantics.
  • Standard services give generic clients shared meaning; configuration and firmware branches can use vendor UUIDs.

Key terms

Because this measurement
Because this measurement is Notify, the client cannot simply read it once and be done.
GATT hierarchy for an environmental monitor with environmental sensing, device information, battery, configuration, and firmware services grouped under one BLE node.
GATT hierarchy for an environmental monitor with environmental sensing, device information, battery, configuration, and firmware services grouped under one BLE node.
iotclass.org

Major section

Deep Dive: Attribute Tables, Handles, and UUID Evidence (continued)

That hierarchy is the map for the handle, CCCD, caching, and reconnect evidence below.

  • 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.
  • It must write 0x0001 to the CCCD at handle 0x002B; after that, the server pushes each new reading from the value handle.
  • The client uses handles as local addresses and UUIDs as meaning.
iotclass.org

Major section

Deep Dive: Attribute Tables, Handles, and UUID Evidence (continued)

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.

  • 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.
iotclass.org

Major section

Worked Example: SPP Throughput vs BLE GATT for Sensor Data Streaming

Active power: 30-50 mA continuously because the connection is maintained.

  • Typical MTU: 990 bytes, so large packets reduce overhead.
  • Problem:: With 7.5 ms interval, max rate is 133 notifications/sec → feasible.
  • Setup complexity: SPP is simpler because it behaves like a serial port; BLE requires GATT service design.

Numbers to remember

990 bytesTypical MTU: 990 bytes, so large packets reduce overhead.
30-50 mAActive power: 30-50 mA continuously because the connection is maintained.
7.5 msProblem:: With 7.5 ms interval, max rate is 133 notifications/sec → feasible.
iotclass.org

Major section

Putting Numbers to It

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.
  • Battery life ratio (800 mAh battery):: SBC battery life: Life_SBC = 800 / 2.87 = 279 hours (radio-only estimate; Sony's rated 30 hours also includes DAC, amplifier, and ANC current that this model doesn't capture).
  • For casual listeners or travelers, SBC's 50% longer runtime is more valuable.
iotclass.org

Major section

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.".

  • A minimal game controller descriptor is 60-100 bytes of carefully structured data.
  • Tested on Android: Worked (Android is lenient with HID descriptors).
  • Tested on iOS: Worked (iOS auto-detects based on UUIDs).
  • Lesson:: HID descriptors are deceptively complex.

Why it matters

Took 3 weeks to debug because Windows HID parser errors are cryptic.

iotclass.org

Deck summary

Key takeaways

Mesh remains a separate many-node control choice.

  • Solution: HID requires authentication and encryption; always enable security features.
  • BLE's GATT (Generic Attribute Profile) and CoAP share a strikingly similar resource-oriented architecture.
  • BLE profile conformance is proved by the discovered attribute table, not by a screenshot of one value arriving.
  • That hierarchy is the map for the handle, CCCD, caching, and reconnect evidence below.
iotclass.org

Retrieval practice

Recall check 1 of 2

Radio Remi says: answer from memory, then check your reasoning.

Q1You're designing a comprehensive smart home hub that needs to: (1) play music to Bluetooth speakers, (2) receive data from BLE temperature sensors, and (3) control a mesh network of smart lights. Which Bluetooth implementation strategy is required?

AClassic Bluetooth only - it supports all these features
BBLE only - it's the modern standard that supports everything
CDual-mode Bluetooth (Classic + BLE) with BLE Mesh support
DBLE Mesh only - mesh can handle all communication types
Show answer

Answer: C Correct!

iotclass.org

Retrieval practice

Recall check 2 of 2

Radio Remi says: answer from memory, then check your reasoning.

Q2Place each Bluetooth profile layer where it lives so you can tell a radio transport primitive from a reusable contract and an end-user use case.

ABaseband and radio
BL2CAP transport
CGAP access contract
DRFCOMM or GOEP
EHID or A2DP profile
Show answer

Answer: A Build upward from radio transport through generic contracts to use-case profiles so you can select compatible roles without treating every layer as a profile.

Q3Complete the code to connect to a BLE device and read a GATT characteristic:

Aasync with BleakClient(DEVICE_ADDRESS) as client:
Bclient = BleakClient.connect(DEVICE_ADDRESS):
Casync with BleakConnect(DEVICE_ADDRESS) as client:
Dclient = await BleakClient(DEVICE_ADDRESS).open():
Show answer

Answer: A BleakClient uses an async context manager for connection management.

iotclass.org

Print reference

Answers

Answer key.

  1. C · Correct!
  2. A · Build upward from radio transport through generic contracts to use-case profiles so you can select compatible roles without treating every layer as a profile.
  3. A · BleakClient uses an async context manager for connection management.
iotclass.org