Bluetooth Low energy Chat Application Series #1

Rahul Lohra
2 min readDec 8, 2018

--

Overview of Chat application -

1. How Bluetooth Low energy device works: https://medium.com/@tgunix/bluetooth-low-energy-chat-application-series-1-f09c16d35b4a

2. Setting up Gatt Server: https://medium.com/@tgunix/bluetooth-low-energy-chat-application-series-2-75e1208179ae

3. Setting up Gatt Client : https://medium.com/@tgunix/bluetooth-low-energy-chat-application-series-3-e1940622ad90

4. Sending Data over Bluetooth Low energy network

5. Some common errors and how to resolve them(Do check this if you are getting some weird error)

Post 1: How Bluetooth Low energy device works in general

Key components

Ble : Bluetooth Low energy device

GATT : Defines protocol(set of rules) on how data should be exchanged

GATT Server : Provides functionality to create Services and broadcast itself so other Gatt Client can connect to it. (can be slightly confusing, I know but don’t worry, this will be cleared later). Treat it as a web server.

Gatt Client : It is responsible for scanning nearby GATT Server, connecting to it and exchanging data(in terms of Characteristics).

Service : A service is a collection of characteristics. For example, you could have a service called “Heart Rate Monitor” that includes characteristics such as “heart rate measurement.”

Characteristics : It contains a value and a list of descriptors. We will be exchanging characteristics as messages

Descriptors : It contains a value and generally it is used as attributes of a characteristics

UUID : Just a unique identifier, on how to uniquely identify a Service or a characteristics or a descriptor.

For exchanging data over http network, we need two devices one will act as a server and another will act as client. Eg — that’s how website work

This same thing applies in Ble network, we need two devices one will act as a Gatt server and another will act as Gatt client for exchanging of data.

And a device can be both Gatt Server and Gatt client.

There are still some concepts left, I will teach them when they are used.

For Android chat application, we will have two devices and they both will act as a Gatt Server and Gatt Client.

Reference — https://developer.android.com/guide/topics/connectivity/bluetooth-le
https://www.bignerdranch.com/blog/bluetooth-low-energy-part-1/

--

--