BLE States : Advertising, Scanning, Connected

Introduction : The Bluetooth link layer defines how devices interact through three main states viz. Advertising, Scanning and Connected. Each state has distinct responsibilities for establishing and maintaining communication.

Advertising State

  • Role: Performed by a Peripheral (or sometimes a Broadcaster).
  • Purpose: Broadcasts small packets of data (advertising packets) over the 3 advertising channels (37, 38, 39) so that other devices can discover it.
  • Contents: Can include device name, UUIDs of available services, manufacturer data, and connection parameters.
  • Advertising Types:
    • Connectable (allows central devices to initiate a connection)
    • Non-connectable (beacons, broadcast-only devices)
  • Transition:
    • Moves to Connected if a central device initiates a connection.
    • Stops advertising when not discoverable.

Scanning State

  • Role: Performed by a Central (or an Observer).
  • Purpose: Listens for advertising packets from peripherals.
  • Modes:
    • Passive Scanning: Only listens, no response.
    • Active Scanning: Listens and requests additional data (Scan Request → Scan Response).
  • Usage: Needed for device discovery before a connection can be established.
  • Transition: Moves to Connected if it sends a connection request to a connectable advertiser.

Connected State

  • Role: Exists between a Central and a Peripheral after a successful connection.

  • Purpose: Allows two-way data exchange using GATT (Generic Attribute Profile).

  • Channel Use: Uses 37 data channels with channel hopping to avoid interference.

  • Security: Encryption can be enabled through pairing/bonding.

  • Connection Parameters:

    • Connection interval (time between communication events)
    • Slave latency (number of intervals the peripheral can skip)
    • Supervision timeout (maximum allowed gap before connection drop)
  • Transition: Moves back to Advertising (peripheral) or Scanning (central) when disconnected.

Conclusion: By mastering link layer states, developers can design BLE systems that connect quickly, consume less energy and maintain stable communication in dynamic environments.