Understanding Bluetooth Low Energy (BLE)

SHARJEEL UR REHMAN
3 min readNov 12, 2024

--

Connectivity with flutter app

1. Introduction to BLE

1.1 What is BLE?

Bluetooth Low Energy (BLE) is a wireless technology designed for short-range communication with minimal power consumption. It’s part of the Bluetooth 4.0+ specification and is optimized for:

  • Battery-operated devices
  • Periodic data transmission
  • Short-range communication
  • Simple device discovery and pairing

1.2 BLE vs Classic Bluetooth

2. Core Concepts

2.1 Device Roles

  1. Central Device: A smartphone or tablet that scans for and connects to multiple peripherals.
  2. Peripheral Device: IoT sensors that advertise their presence and accept connections from a central device.

2.2 States and Transitions

  1. Advertising State: Device broadcasts its presence with basic information over specific channels.
  2. Scanning State: Central device searches and filters advertisers.
  3. Connected State: Enables two-way data exchange with power-saving features.

3. BLE Protocol Stack

3.1 Physical Layer: Operates on a 2.4 GHz band with 40 RF channels using GFSK modulation at 1 Mbps.

3.2 Link Layer: Manages advertising, scanning, connections, error detection, and flow control.

3.3 Host Layer

  1. L2CAP: Handles data multiplexing, segmentation, and QoS.
  2. ATT: Organizes data with basic read/write access methods.
  3. GATT: Defines data structures, service discovery, and characteristic operations.
  4. GAP: Manages device discovery, connections, and security features.

4. GATT Architecture

4.1 Hierarchy

Profile
└── Service
└── Characteristic
└── Descriptor

4.2 Components

  1. Services: Group related features, identified by UUID, as standard or custom services.
  2. Characteristics: Holds data with properties (read/write/notify), a value field, and descriptors.
  3. Descriptors: Provides extra information, configuration, and user descriptions.

5. Connection Process

5.1 Device Discovery: Peripheral advertises, central scans, processes packets, and filters devices.
5.2 Connection Establishment: Central sends connection request, negotiates parameters, and establishes link.
5.3 Service Discovery: Finds primary services, characteristics, descriptors, and collects handles.

6. Power Management

6.1 Connection Parameters: Defines connection interval, slave latency, and supervision timeout.
6.2 Power States

  1. Active: Full power mode for data transfer.
  2. Sleep: Low power mode with periodic wake-ups.
  3. Standby: Medium power mode with quick wake-up.

7. Security Features

7.1 Pairing Methods

  1. Just Works: No interaction; limited security.
  2. Passkey Entry: User confirms code for man-in-the-middle protection.
  3. Out of Band: Uses external channel for maximum security.

7.2 Security Levels

  1. No Security: Open connection without encryption.
  2. Encryption Only: Protects data without authentication.
  3. Authentication and Encryption: Verifies devices with secure connection.

8. Common Use Cases

8.1 Healthcare: Devices like heart rate monitors, glucose meters, fitness trackers, and temperature sensors.
8.2 Smart Home: Includes smart locks, light controls, environmental sensors, and presence detectors.
8.3 Industrial: Used for asset tracking, machine monitoring, environmental sensing, and predictive maintenance.

9. Limitations and Considerations

9.1 Technical Limitations: Includes range limits, data rate constraints, topology, and interference.
9.2 Design Considerations: Optimizes battery life, enhances security, improves user experience, and considers environmental factors.

--

--

SHARJEEL UR REHMAN
SHARJEEL UR REHMAN

Written by SHARJEEL UR REHMAN

Experienced Flutter dev with 3 yrs exp. Specializes in mobile apps. Skilled in , Clean Architecture, Bloc,Focuses on scalable, maintainable code.

No responses yet