nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
cts_client.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef BT_CTS_CLIENT_H_
8#define BT_CTS_CLIENT_H_
9
18#include <zephyr/bluetooth/gatt.h>
19#include <zephyr/bluetooth/conn.h>
20#include <bluetooth/gatt_dm.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
28 uint16_t year;
29 uint8_t month;
30 uint8_t day;
31 uint8_t hours;
32 uint8_t minutes;
33 uint8_t seconds;
34 uint8_t day_of_week;
35 uint8_t fractions256;
36};
37
45
51
52struct bt_cts_client;
53
62typedef void (*bt_cts_read_cb)(struct bt_cts_client *cts_c,
63 struct bt_cts_current_time *current_time,
64 int err);
65
74typedef void (*bt_cts_notify_cb)(struct bt_cts_client *cts_c,
75 struct bt_cts_current_time *current_time);
76
80 struct bt_conn *conn;
81
83 uint16_t handle_ct;
84
86 uint16_t handle_ct_ccc;
87
89 atomic_t state;
90
92 struct bt_gatt_read_params read_params;
93
95 struct bt_gatt_subscribe_params notify_params;
96
99
102};
103
115
125
136 bt_cts_notify_cb func);
137
147
161int bt_cts_handles_assign(struct bt_gatt_dm *dm, struct bt_cts_client *cts_c);
162
163#ifdef __cplusplus
164}
165#endif
166
171#endif /* BT_CTS_CLIENT_H_ */
void(* bt_cts_notify_cb)(struct bt_cts_client *cts_c, struct bt_cts_current_time *current_time)
Value notification callback.
Definition cts_client.h:74
int bt_cts_subscribe_current_time(struct bt_cts_client *cts_c, bt_cts_notify_cb func)
Subscribe to the current time value change notification.
int bt_cts_client_init(struct bt_cts_client *cts_c)
Function for initializing the Current Time Service client.
int bt_cts_read_current_time(struct bt_cts_client *cts_c, bt_cts_read_cb func)
Function for reading the peer's Current Time Service Current Time characteristic.
void(* bt_cts_read_cb)(struct bt_cts_client *cts_c, struct bt_cts_current_time *current_time, int err)
Read complete callback.
Definition cts_client.h:62
int bt_cts_handles_assign(struct bt_gatt_dm *dm, struct bt_cts_client *cts_c)
Function for assigning handles to this instance of cts_c.
int bt_cts_unsubscribe_current_time(struct bt_cts_client *cts_c)
Remove the subscription.
uint8_t external_reference_time_update
Definition cts_client.h:41
uint8_t manual_time_update
Definition cts_client.h:40
uint8_t change_of_time_zone
Definition cts_client.h:42
uint8_t change_of_daylight_savings_time
Definition cts_client.h:43
"Adjust Reason" field of the Current Time characteristic.
Definition cts_client.h:39
bt_cts_read_cb read_cb
Definition cts_client.h:98
struct bt_gatt_read_params read_params
Definition cts_client.h:92
uint16_t handle_ct_ccc
Definition cts_client.h:86
bt_cts_notify_cb notify_cb
Definition cts_client.h:101
struct bt_gatt_subscribe_params notify_params
Definition cts_client.h:95
struct bt_conn * conn
Definition cts_client.h:80
atomic_t state
Definition cts_client.h:89
uint16_t handle_ct
Definition cts_client.h:83
Current Time Service client structure. This structure contains status information for the client.
Definition cts_client.h:78
struct bt_cts_exact_time_256 exact_time_256
Definition cts_client.h:48
struct bt_cts_adjust_reason adjust_reason
Definition cts_client.h:49
Data structure for the Current Time characteristic.
Definition cts_client.h:47
uint8_t fractions256
Definition cts_client.h:35
uint8_t day_of_week
Definition cts_client.h:34
uint8_t seconds
Definition cts_client.h:33
uint8_t day
Definition cts_client.h:30
uint8_t hours
Definition cts_client.h:31
uint8_t month
Definition cts_client.h:29
uint16_t year
Definition cts_client.h:28
uint8_t minutes
Definition cts_client.h:32
"Exact Time 256" field of the Current Time characteristic.
Definition cts_client.h:27