System and method for clock synchronization on a wireless network
10462759 ยท 2019-10-29
Assignee
Inventors
Cpc classification
H04W56/0055
ELECTRICITY
H04W4/80
ELECTRICITY
H04L41/0645
ELECTRICITY
International classification
H04W4/80
ELECTRICITY
H04W40/24
ELECTRICITY
Abstract
A method of synchronizing the clocks of a master device and at least a first slave device which are connected on a wireless network. The method includes sending a scan command from the master device to at least the first slave device, setting the master device to a broadcast mode and broadcasting data, the broadcast data comprising a first time stamp; scanning the broadcasting data at at least the first slave device and resetting the clock of the first slave device using the first time stamp. In particular, but not exclusively, the present disclosure relates to synchronizing the clocks of two devices which are connected on a Bluetooth Low Energy (BLE) wireless network.
Claims
1. A method of synchronising the clocks of a master device and at least a first slave device which are connected on a BLE network, the method comprising: sending a scan command from the master device to at least the first slave device; setting the master device to a broadcast mode and broadcasting data, the broadcast data comprising a first time stamp; and scanning the broadcasting data at at least the first slave device and resetting the clock of the first slave device using the first time stamp.
2. The method as claimed in claim 1, comprising synchronising the clocks of a master device and a plurality of slave devices.
3. The method as claimed in claim 1, including sending the scan command to at least the first slave device to scan at least one advertising channel, and broadcasting data from the master device on at least one advertising channel.
4. The method as claimed in claim 1, including configuring the master device to broadcast only one set of advertising packets.
5. The method as claimed in claim 1, including configuring the master device to broadcast data between two successive connection events.
6. The method as claimed in claim 1, including configuring at least the first slave device to send a second time stamp to the master device.
7. The method as claimed in claim 6, including configuring the master device to compare the received second time stamp with a time of receipt of the second time stamp.
8. A system comprising a master device connected to at least a first slave device on a BLE network, wherein the master device is configured to: send a scan command to at least the first slave device; and switch to a broadcast mode and broadcast data, the broadcast data comprising a first time stamp, and wherein at least the first slave device is configured to: scan the broadcasting data and reset the clock of the first slave device using the first time stamp.
9. The system as claimed in claim 8, wherein the master device is connected to a plurality of slave devices.
10. The system as claimed in claim 8, wherein the first slave device is configured to scan at least one advertising channel, and wherein the master device is configured to broadcast data on at least one advertising channel.
11. The system as claimed in claim 8, including configuring the master device to broadcast data between two successive connection events.
12. The system as claimed in claim 8, wherein the master device is configured to broadcast only one set of advertising packets.
13. The system as claimed in claim 8, wherein subsequent to reconnecting the master device and at least the first slave device, at least the first slave device is configured to send a second time stamp to the master device.
14. The system as claimed in claim 13, wherein the master device is configured to compare the received second time stamp with a time of receipt of the second time stamp.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The disclosure will be described below, by way of example only, with reference to the accompanying drawings, in which:
(2)
(3)
(4)
(5)
(6)
DESCRIPTION
(7) BLE is defined in various standards documents, including for example the Specification of the Bluetooth System, Covered Core Package version 4.2, Volumes 1-7, which are hereby incorporated by reference.
(8)
(9) The master device 120 comprises a host device 122 which has an internal clock 124 and is connected to a network interface controller 126 which manages connection of the host device 122 to a wireless network via an RF transceiver 128. Similarly, the slave device 130 comprises a host device 132 which has an internal clock 134, a network interface controller 136 and an RF transceiver 138.
(10) The master device 120 coordinates the medium access by using a Time Division Multiple Access (TDMA) scheme. The master device 120 also provides the slave device 130 with the information needed for frequency hopping when transmitting data and for the connection supervision. The parameters for the management of a connection, such as the value of the connection interval, are transmitted in the Connection Request message. The connection interval may be in the range of 7.5 ms to 4.0 s.
(11)
(12) When the master device 120 and the slave device 130 are connected, the physical channel is divided into non-overlapping time units called connection events 140. During a connection event 140, the master and slave devices alternate sending and receiving data packets. Only one connection event 140 occurs within each connection interval, therefore every 7.5 ms.
(13) As part of a synchronisation procedure, the application on the host device 122 generates a first time stamp 142 which is sent to the controller 126 for transmitting to the slave device 130. However, the first time stamp 142 is not sent until the next connection event 140 and so there is a random delay 144 of between zero and 7.5 ms. Once transmitted, the first time stamp 142 is received by the controller 136 of the slave device 130 and passed to the host device 132. If the clock 134 of the slave device 130 is reset based upon the first time stamp 142, the master and slave devices will not be accurately synchronised due to the delay 144.
(14)
(15) As before, a master device 20 comprises a host device 22, an internal clock 24, a network interface controller 26 and an RF transceiver 28. Similarly, a first slave device 30 comprises a host device 32, an internal clock 34, a network interface controller 36 and an RF transceiver 38. Also, a second slave device 50 comprises a host device 52, an internal clock 54, a network interface controller 56 and an RF transceiver 58.
(16)
(17) The three devices are all initially connected. At step 60, the master device 20 sends a scan command to both slave devices. This causes them to switch to scanning mode.
(18) The master device 20 specifies a relatively long scanning period, say 1 s, for each slave device. At step 62, the slave devices begin scanning for broadcast data on the advertising channels. In the scanning mode, a device continuously listens for broadcast data.
(19) At step 64, the master device 20 switches to broadcast mode. It then broadcasts data which includes a first time stamp 142 at step 66. In the broadcasting mode, data is sent once every specified broadcast interval. The master device 20 specifies a relatively long broadcast interval, say 1 s. However, the master device 20 immediately stops broadcasting after one set of advertising packets have been sent.
(20) The advertising packets are broadcast immediately after being generated. There is only a small, deterministic delay as the generated first time stamp 142 is passed to the controller 26 of the master device 20. Since the devices are connecting via Bluetooth, the devices are near to each other and so there is virtually no delay associated with the transmission between devices since the data is transmitted at light speed.
(21) At step 68, each slave device receives the first time stamp 142. Since the slave devices are near to each other, they will receive the first time stamp 142 at virtually the same time.
(22) Also, the slave devices will receive the first time stamp 142 within a microsecond or so from the time the first time stamp 142 was generated and sent by the master device 20. As the advertising packets are being broadcast immediately, and because the slave devices are continuously and already listening in scanning mode, there is no random delay.
(23) In a preferred embodiment, the steps of sending the scan command, setting the master device to the broadcast mode and broadcasting data, and scanning the broadcasting data are all performed between two successive connection events. Before the next connection event, the master and slave devices are switched back to their initial connection mode. Therefore, the devices do not need to go through the connection procedure to reconnect.
(24) In an alternative embodiment, the master and slave devices disconnect before performing the broadcasting and scanning steps and then reconnect afterwards.
(25) At step 70, each slave device resets its clock in accordance with the first time stamp 142. This results in each of the master device 20, first slave device 30 and second slave device 50 being accurately synchronised to within a microsecond or so.
(26) At step 72, each slave device then generates and sends a second time stamp to the master device 20. This is received at the master device 20 and then compared with a time of receipt of the second time stamp at step 74. This verifies both that the clocks of the slave devices are synchronised with each other and with the master device 20.
(27) Various modifications and improvements can be made to the above without departing from the scope of the disclosure. For instance,