Bluetooth Low Energy, from the radio up · Puzzle 2 · 3 of 5
A timetable for two
In puzzle 1, the phone found the strap by listening to its advertisements. Now two devices that both sleep need to talk again and again, without missing each other.
The problem
In puzzle 1, the phone found the strap by listening until an advertisement landed. That's fine for finding it once. But a heart rate changes every second, and both radios want to sleep. If they only meet by luck, data arrives late or not at all. How do two sleepers meet on time, every time?
See it
Right after an advertisement, the phone answers: "connect?". Now they're in a connection. The phone, which asked, is the central and sets the timing; the strap is the peripheral.
Step 1 of 4The central sets a timetable: meet every connection interval, from 7.5 ms up to 4 s. In between, both radios sleep.
Step 2 of 4Each meeting is a connection event: both wake at the agreed moment, exchange packets, and sleep. Predict: is every meeting on the same channel?
Step 3 of 4No: each event uses a different channel, picked by a rule both sides know. Noise on one channel only spoils the events that land on it.
Step 4 of 4
The building block
The phone answers an advertisement with a request to connect, in the moment the strap listens after advertising (puzzle 1). From then on, the two are in a connection, and each has a role. The side that sent the request becomes the central, which sets the timing: usually the phone, because the phone is the one that goes looking. The side that advertised becomes the peripheral, which follows it: usually the small device.
In its request, the central sets a timetable: meet every connection interval. The same request also carries the rule for picking each meeting's channel, so both sides know it from the start. The connection interval is a multiple of 1.25 ms, from 7.5 ms up to 4 s. Short means data moves sooner but more radio time; long means slow replies and a longer battery life. The central can change it later.
Each meeting is a connection event. Both radios wake at the agreed moment, exchange packets, and sleep again until the next one. If neither has anything to say, they swap tiny empty packets, just enough to stay in step. Because both know the timetable, neither has to listen in between.
Each connection event happens on a different channel, picked from the 37 non-advertising channels by a rule both sides know. If one channel is noisy, only the events that land on it suffer.
The analogy
Two lighthouse keepers who need to talk every night agree on a time: "every hour, on the hour". At each hour both light up, signal, and go dark again. And each hour they use a different color, picked by a list both have, so fog on one color doesn't silence them.
Check yourself
Sources
- Bluetooth Core Specification 5.4, Vol 6, Part B: Link Layer ("The connInterval shall be a multiple of 1.25 ms in the range 7.5 ms to 4.0 s. The connInterval is set by the Initiator's Link Layer… and can be changed using the Connection Update procedure"; "A Link Layer in the Central Role is called a Central… The Central controls the timing of a connection event"; channel selection: "the unmapped channel index for the current connection event")
What you now know
In a connection, the central (the phone) sets a timetable: meet every connection interval, 7.5 ms to 4 s. At each connection event both wake, exchange packets on a channel picked by a shared rule, and go back to sleep.
Answer every question above correctly to unlock the next puzzle.
Something wrong or unclear on this page? Tell me: a puzzle that didn't click is a bug in the puzzle.