CNIC Information System with Pakdata Cf In Pakistan
Bluetooth technology introduction and ecosystem
1. Reconnect to your body.
Know your vitals.
Niclas Granqvist, CTO
granqvist@nanoleq.com
2. • Bluetooth SIG
• Bluetooth technology
• Markets and Global Success
• Marketing
• What You Must
• LL – Link Layer
• L2CAP – Multiplexer
• ATT – Attribute Protocol
• GATT – Generic Attribute Profile
• GAP – Generic Access Profile
• DIS – Device Information Service
• Bluetooth LE Health Services
• Qualification
• What else does Bluetooth provide?
• What is Nanoleq doing?
Content
3. • Founded September 1998
• Bluetooth SIG is worlds largest Special Interest Group: ~36 000 member
companies
• Jaap Haartsen, inventor
• 2 Membership levels adopters(free) and associate
• Promotor level is for BoD companies: Microsoft, Intel, Apple, Ericsson, Motorola, Nokia and
Toshiba
• A few associates that are selected among member companies
• Bluetooth SIG is run as a “not-for-profit”
Bluetooth SIG
6. Bluetooth Low Energy is the most
successful low power radio
technology ever launched shipping in
billions.
The reason was the combination with
BR/EDR
Global Success!
7. The members develop the specifications and the SIG adopts the spec.
• Adoption means that Bluetooth SIG takes ownership of the specification
• Bluetooth SIG immediately licenses it back to the member on the condition that
you show interoperability by going through a qualification program and paying a
listing fee
• The members cross license. You can not sue for another company using your IP
in the spec. Patents can be used passively for defence
• The Bluetooth license is royalty free, unlimited, perpetual and irrevocable
• The specification development is the heart of Bluetooth
• The Bluetooth qualification program is maybe the most important service as
each product must pass to be qualified
• A significant part of the Bluetooth is marketing promotion but also promotion of
members solutions.
Development model
8. • You must be a member of the SIG
• You must ensure that the product is properly qualified and listed
• You must follow the Bluetooth brand guidelines
Simple, Secure and Everywhere
What you must
9. • Bluetooth is one of the most recognized brands in the world
• Correct marketing is important for the message and integrity of the brand
• Read the Bluetooth brand guidelines before making the product design
Bluetooth Brand Marketing
10. • Members develops the Bluetooth specifications
• 1.0, 1.0b, 1.1, 1.2, 2.0, 2.1, 3.0, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 5.3
Core specfications
• Release cadence has increased over past years
• Rule of thumb: Major version change means new HW. Minor
implies a software update may be enough
• Backwards compatible
• Core specification (BR/EDR and LE)
• In total ~5 different radio specifications
• 2 Mbits e.g. useful for FW updates and music
• 1 Mbits, best range and general performance
• Long Range: 500 & 125 kbits: > 600 meters in open air
• Specifications to support applications
• Bluetooth LE services and profiles
• Bluetooth classic profiles and protocols
• Bluetooth Mesh and mesh models
• Tests for qualification
Bluetooth SIG spec dev.
Core spec 5.2
3256 pages
7142 Shalls
766 Shoulds
+ 2020 Mays
=============
9 928 conditions to remember!
11. Bluetooth is a hierarchal stack
• Stack divided into logical layers
• Each layer has clear responsibilities
• Mixing layers is a “layer violation”
• Layers should not know of each other
• Layers have feature bits for future
enhancements
The packet is the sum of the layers
Advantages
• Layers can evolve independently
• Layers can be added or removed
Hierarchal stacks
Application
Services Data
GATT/ATT
MUX – L2CAP
LINK LAYER
Preamble Acc. adr LL LL
L2CAP ATT Data
BLE layout
Radio
12. OSI model and Bluetooth
Android and iOS API integration
BLE Profile
BLE Application stack
BLE Service / GATT
ATT Protocol /
L2CAP
BLE Link Layer
BLE radios
BLE Mesh
network
Mesh
transport
Models
H
o
s
t
C
o
n
t
r
o
l
l
e
r
BLE is point to point
No sessions
14. • Low peak currents, coin cell technology
• Optimised for small and infrequent data
• Cheap and robust, not fast
• Cheap, robust and fast. Pick two!
• 1 Mbits is fast enough for most simple devices
Robustness
• Channel hopping to combat WIFI and multipath
• Data whitening to optimise receiver performance
• Advertisement channels (3) in-between wifi channels
• Long CRC (3 bytes) to ensure that bits are correct
• Good enough for medical applications
• Encryption gurantees integrity
• Link layer will retry an unsuccessful transfer
• Device address made so as to increase correlation in noise
• ATT transport protocol has acknowledgement, if needed
• Extended advertising reduces load on current channels
BLE Communication System
15. • Centrals control connections
• Peripheral obey
• A device can be master and
slave at the same time
• You can have many LL state
machines
• This is all LL terminology. In
most cases better to use GAP:
Central, Peripheral, Observer
and Broadcaster
Link Layer State Machine
Slave Master
Sound,
Streaming
Data, ECG
Find devices
Advertising
Chains on sec. adv.
channels
Connection
creation
Sensor ready
For discovery
and connection
16. • BLE 4.0 was a star topology
• BLE >4.1 is scatternet
• Advertisements are broadcasts
• Connections are unicasts
Example:
The Polar H10 heart rate sensor can be
connected to two masters at the same time
Topology
M/Sl
Sl M
M
Sl
Sl Sl
Adv
Sc
Sc
Sc
Scatternet:
Star:
Sl
M
M
Polar
H10
Sl
Broadcasts
17. All data packets are modifications of one basic format.
This keeps BLE simple
PDU = protocol data unit
BLE packet format
Allows some
time for the
AGC to
stabilise
Address of the
device, correlator
Data Error check
Long range packet
1 Mbit/sec =
1 bit = 1 usec
(Symbol time)
TERM1,2 are for
error correction
18. • An advertisement PDU is can be
directed or undirected
• Undirected = broadcast
• Directed = for one special device
• Advertisements can be
connectable or non-connectable
• AD structures encode data using
UUIDs
BT 5.0 has a new elaborate
advertising functions for long range,
synch chains, sec. adv. channels etc
Advertisement data format
20. BLE: GATT Data
exchange can start after
exchange of one packet.
It takes Bluetooth
classic average ~100
ms to get to data
exchange because
“many” protocols must
be setup
Initiate connection
Master
Slave
21. Once two devices are in a connection, either device
can send data. This example shows both devices
sending data, for example when the Attribute
Protocol does a read request and a read response
is returned
There are two channel hopping algorithms. The
newer channel hopping algorithm is superior
Data Exchange
22. • Use More Data (MD) bit when more to say
• SN, NSN for ack
• Lazy ack to save 50% energy
MD and SN
24. If reception stops
• The master receives no response
• The slave receive no poll package
then the link layers will inform the hosts that the a disconnection has
occurred.
This is called a supervision timeout.
Supervision Timeout
25. BLE security features
BLE has a cryptographic toolbox that allows for various use
1. Encryption (AES-128 bit) (hides message, integrity, authentication of
every packet)
2. Authentication
3. Privacy, the ID of the device can be obfuscated. This makes it impossible
to scan for BLE devices as the unique device ID is changing periodically
4. Data Signing
5. Authorisation
All algorithms are standard algorithms that are well understood!
26. L2CAP is a sophisticated data
multiplexer
• Is part of the host
• Provides static and dynamic
data streams between hosts
• Splits large packets into
pieces and moves the parts.
• The receiving host reassembles the
parts
• The unhenhanced ATT bearer
is using CID 0x04 that is a
static port. This is highly
efficient and saves battery
L2CAP
27. • GATT is a client server architecture, compare to http
• Clients collect data
• Sensors are services and send notifications with data
• The roles are not fixed. The first one issuing a PDU determines the role
• A server can handle multiple clients
• Decouples development of the two ends
• GATT is stateless
• GATT services are considered immutable (never change, once deployed)
• GATT services are collections of characteristics structured into services
• Service UUIDs identify the type of service. A service consist of characteristics
• Characteristics return data, e.g. HR and RR
• Characteristics have UUID
• Another characteristic return the measurement location
• BT SIG UUID = 16 bit, company defined 128 bit randomised
• Characteristics have operations
• Notifications and indications (acknowledged)
• Read data
• Write data
• Special operations for e.g. automation multiple characteristic writes + commit
• Characteristics have security e.g. a certain operation may require encryption
GATT
Server
Client
Client
Client
Server
28. Generic attribute profile (GATT)
• Enable large scale interoperable ecosystems of data
• Asynchronous data
• Bluetooth has no QoS but it is best effort
• Enable applications on phones, watches
• Build smarter applications
• Be small and efficient
• GATT uses a static port (compare to UDP in TCP/IP) and does not need to
configure L2CAP. This saves ~6 packets.
• GATT discovery and execution is all done using one protocol,
ATT protocol
• Bluetooth classic needs minimum 2 protocols
• The attribute protocol is used throughout BLE. Keep it simple!
• GATT is a way to describe structured and unstructured data
• Profiles describe use cases (roles, security, advertising etc)
GATT
Services
GATT
ATT
Profile
GAP
Use case
29. • Used by GATT & higher level profiles to implement services
• Can be independently qualified and can be used on it’s own if ever
needed
ATT (Attribute protocol)
30. 1. The first step is always to discover all services
• If the GATT database has not changed then this is unnecessary, GATT caching, bonded?
• Hash
2. Configure the proper characteristics
3. Enable notifications - Communicate !
Service Discovery
31. • Bluetooth 5.2 supports enhanced bearers
• The enhanced bearer allows for collections of
services
• Solves fundamental limitations in ATT for
complex multi-service scenarios
Service Collections
Device 2
Collection 21
Client 1
Collection 22
Service 1
Service 2
Device 1
Collection 11
Client 1
Collection 12
Service 1
Service 2
32. Most layers can support company specific information when needed.
• L2CAP has dynamic channels
• GATT has 128 bits services
• Company specific advertisement information
As a rule a protocol commands cannot be added in any layer ATT, L2CAP
and LL are fixed
Company specific info
34. It considered good practice to support DIS in every device.
Always implement all relevant DIS characteristics
Device Information Service
35. Reuse GATT services
Name Version Year
BAT Battery Service 1.0 2011
FTMS Fitness Machine Service 1.1 2017
DIS Device Information Service 1.1 2011
UDS User Data Service 1.1 2019
PAMS Physical Activity Monitor Service 1.0 1.0 2020
HRS Heart Rate Service 1.0 2011
HTS Health Thermometer Service 1.0 2011
PLXS Pulse Oximeter Service 1.0 2015
OTS Object Transfer Service 1.0 1.0 2015
Useful services to promote open data
Make your own GATT service if not one of the existing ones.
36. Some principles
• All products must be qualified
• The qualification is validation of design. The required commitment to
interoperability goes beyond testing. It must work!
• What has been tested does not need to be tested a second time
• Changes need to be assessed and tested
• Start project using Bluetooth Launch Studio
• Download and use PTS for testing
• Tip: The testing specifications are very useful when implementing as they
list all possible mandatory and optional features explicitly. Study testing
specs before implementation!
• Fees: Listing fee 8000 USD for adopters for a product family
Bluetooth Qualification
37. • Long range radio
• Stay connected even if phone is far away
• Android has fairly good support
• Advertising and Extended advertising
• Beacons
• Used in group training and workwear
• Direction finding AoA & AoD (5.1)
• Touch and go, integration with NFC
• Out of band TKs
• Isochronous channels (streaming data: sound, ECG) (5.2)
• Can be used for other types of data, too!
• LE power control (5.2) – minimises output power in closed loop
Other useful core features?
38. We are building a ground-
breaking e-textile multi service
solution for your body!
Nanoleq plans eclipses
everything the industry has
done so far in scope and
sophistication
What is Nanoleq doing?