Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Elapsed Time Service callback structure. More...

#include <zephyr/bluetooth/services/ets.h>

Data Fields

int(* read_elapsed_time )(struct bt_ets_elapsed_time *time)
 Read elapsed time callback (MANDATORY).
int(* read_clock_status )(uint8_t *status)
 Read clock status (BT_ETS_CLOCK_STATUS) callback (MANDATORY).
enum bt_ets_write_result(* write_elapsed_time )(const struct bt_ets_elapsed_time *time)
 Write elapsed time callback (OPTIONAL).
void(* indication_changed )(bool enabled)
 Indication subscription changed callback (OPTIONAL).

Detailed Description

Elapsed Time Service callback structure.

Field Documentation

◆ indication_changed

void(* bt_ets_cb::indication_changed) (bool enabled)

Indication subscription changed callback (OPTIONAL).

Called when a client enables or disables indications for the Current Elapsed Time characteristic.

Parameters
enabledTrue if indications enabled, false if disabled.

◆ read_clock_status

int(* bt_ets_cb::read_clock_status) (uint8_t *status)

Read clock status (BT_ETS_CLOCK_STATUS) callback (MANDATORY).

Called when a BLE client reads the Current Elapsed Time characteristic. Application must return the current clock status flags.

Parameters
statusPointer to store clock status byte.
Return values
0On success.
-errnoNegative errno on failure.

◆ read_elapsed_time

int(* bt_ets_cb::read_elapsed_time) (struct bt_ets_elapsed_time *time)

Read elapsed time callback (MANDATORY).

Called when a BLE client reads the Current Elapsed Time characteristic. Application must fill the elapsed time structure with current time information.

Parameters
timeElapsed time structure to fill.
Return values
0On success.
-errnoNegative errno on failure.

◆ write_elapsed_time

enum bt_ets_write_result(* bt_ets_cb::write_elapsed_time) (const struct bt_ets_elapsed_time *time)

Write elapsed time callback (OPTIONAL).

Called when a BLE client writes to the Current Elapsed Time characteristic. Only applicable if

Attention
Available only when the following Kconfig option is enabled: CONFIG_BT_ETS_CURRENT_ELAPSED_TIME_WRITABLE. is enabled. Application should validate time source quality, range, and other constraints.
Note
Clock Status and Clock Capabilities are excluded from writes per spec.
Parameters
timeElapsed time structure written by client.
Returns
Result code indicating acceptance or specific rejection reason.

The documentation for this struct was generated from the following file:
  • zephyr/bluetooth/services/ets.h