summaryrefslogtreecommitdiff
path: root/doc/ble.md
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-04-05 17:03:06 +0200
committerJF <jf@codingfield.com>2020-04-05 17:03:06 +0200
commit932c0479ee7c501bc224435943c73a368001845e (patch)
tree42e02ec27abd978fbd8bf0a3f9b94c4d2cc21d12 /doc/ble.md
parent26fb9ed1cd8752438ed0ca9be3c286ddfc696b40 (diff)
Add documentation about BLE connection and services.
Diffstat (limited to 'doc/ble.md')
-rw-r--r--doc/ble.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/ble.md b/doc/ble.md
new file mode 100644
index 00000000..0302b471
--- /dev/null
+++ b/doc/ble.md
@@ -0,0 +1,27 @@
+# Bluetooth Low-Energy :
+## Introduction
+This page describes the BLE implementation and API built in this firmware.
+
+**Note** : I'm a beginner in BLE related technologies and the information of this document reflect my current knowledge and understanding of the BLE stack. These informations might be erroneous or incomplete. Feel free to submit a PR if you think you can improve these.
+
+## BLE Connection
+When starting the firmware start a BLE advertising : it send small messages that can be received by any *central* device in range. This allows the device to announce its presence to other devices.
+
+A companion application (running on a PC, RasberryPi, smartphone) which received this avertising packet can request a connection to the device. This connection procedure allows the 2 devices to negociate communication parameters, security keys,...
+
+When the connection is established, the pinetime will try to discover services running on the companion application. For now **CTS** (**C**urrent **T**ime **S**ervice) and **ANS** (**A**lert **N**otification **S**ervice) are supported.
+
+If **CTS** is detected, it'll request the current time to the companion application. If **ANS** is detected, it will listen to new notifications coming from the companion application.
+
+![BLE connection sequence diagram](ble/connection_sequence.png "BLE connection sequence diagram")
+
+## BLE services
+[List of standard BLE services](https://www.bluetooth.com/specifications/gatt/services/)
+
+### CTS
+[Current Time Service](https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.alert_notification.xml)
+
+### ANS
+[Alert Notification Service](https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.current_time.xml)
+
+![ANS sequence diagram](./ble/ans_sequence.png "ANS sequence diagram") \ No newline at end of file