Elapsed Time Service (ETS) Peripheral

Browse source code on GitHub

Overview

Similar to the Peripheral sample, except that this application specifically exposes the ETS (Elapsed Time Service) GATT Service.

The sample demonstrates time-of-day mode using the system realtime clock (SYS_CLOCK_REALTIME). It supports both UTC time (default) and local time with TZ/DST offset (via overlay). The implementation uses ETS helper APIs for all time conversions between Unix epoch (1970) and ETS epoch (2000).

Requirements

  • BlueZ running on the host, or

  • A board with Bluetooth LE support

Building and Running

This sample can be found under samples/bluetooth/peripheral_ets in the Zephyr tree.

Building with UTC time mode (default)

# From the root of the zephyr repository
west build -b <board> samples/bluetooth/peripheral_ets
west flash

Building with local time mode

# From the root of the zephyr repository
west build -b <board> samples/bluetooth/peripheral_ets -- -DEXTRA_CONF_FILE=overlay-local-time.conf
west flash

See Bluetooth samples for details.

See also

Elapsed Time Service (ETS)
Bluetooth APIs