Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ots.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTS_H_
8#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTS_H_
9
21
22#include <stdbool.h>
23#include <stdint.h>
24
25#include <sys/types.h>
26
28#include <zephyr/sys/util.h>
29#include <zephyr/sys/crc.h>
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
39#define BT_OTS_OBJ_ID_SIZE 6
40
42#define BT_OTS_OBJ_ID_MIN 0x000000000100ULL
43
45#define BT_OTS_OBJ_ID_MAX 0xFFFFFFFFFFFFULL
46
48#define OTS_OBJ_ID_DIR_LIST 0x000000000000ULL
49
51#define BT_OTS_OBJ_ID_MASK BIT64_MASK(48)
52
54#define BT_OTS_OBJ_ID_STR_LEN 15
55
58 union {
59 /* Used to indicate UUID type */
60 struct bt_uuid uuid;
61
62 /* 16-bit UUID value */
64
65 /* 128-bit UUID value */
67 };
68};
69
71enum {
74
77
80
83
89
92
99
102};
103
108#define BT_OTS_OBJ_SET_PROP_DELETE(prop) \
109 WRITE_BIT(prop, BT_OTS_OBJ_PROP_DELETE, 1)
110
115#define BT_OTS_OBJ_SET_PROP_EXECUTE(prop) \
116 WRITE_BIT(prop, BT_OTS_OBJ_PROP_EXECUTE, 1)
117
122#define BT_OTS_OBJ_SET_PROP_READ(prop) \
123 WRITE_BIT(prop, BT_OTS_OBJ_PROP_READ, 1)
124
129#define BT_OTS_OBJ_SET_PROP_WRITE(prop) \
130 WRITE_BIT(prop, BT_OTS_OBJ_PROP_WRITE, 1)
131
136#define BT_OTS_OBJ_SET_PROP_APPEND(prop) \
137 WRITE_BIT(prop, BT_OTS_OBJ_PROP_APPEND, 1)
138
143#define BT_OTS_OBJ_SET_PROP_TRUNCATE(prop) \
144 WRITE_BIT(prop, BT_OTS_OBJ_PROP_TRUNCATE, 1)
145
150#define BT_OTS_OBJ_SET_PROP_PATCH(prop) \
151 WRITE_BIT(prop, BT_OTS_OBJ_PROP_PATCH, 1)
152
157#define BT_OTS_OBJ_SET_PROP_MARKED(prop) \
158 WRITE_BIT(prop, BT_OTS_OBJ_PROP_MARKED, 1)
159
164#define BT_OTS_OBJ_GET_PROP_DELETE(prop) \
165 ((prop) & BIT(BT_OTS_OBJ_PROP_DELETE))
166
171#define BT_OTS_OBJ_GET_PROP_EXECUTE(prop) \
172 ((prop) & BIT(BT_OTS_OBJ_PROP_EXECUTE))
173
178#define BT_OTS_OBJ_GET_PROP_READ(prop) \
179 ((prop) & BIT(BT_OTS_OBJ_PROP_READ))
180
185#define BT_OTS_OBJ_GET_PROP_WRITE(prop) \
186 ((prop) & BIT(BT_OTS_OBJ_PROP_WRITE))
187
192#define BT_OTS_OBJ_GET_PROP_APPEND(prop) \
193 ((prop) & BIT(BT_OTS_OBJ_PROP_APPEND))
194
199#define BT_OTS_OBJ_GET_PROP_TRUNCATE(prop) \
200 ((prop) & BIT(BT_OTS_OBJ_PROP_TRUNCATE))
201
206#define BT_OTS_OBJ_GET_PROP_PATCH(prop) \
207 ((prop) & BIT(BT_OTS_OBJ_PROP_PATCH))
208
213#define BT_OTS_OBJ_GET_PROP_MARKED(prop) \
214 ((prop) & BIT(BT_OTS_OBJ_PROP_MARKED))
215
220
223} __packed;
224
226enum {
229
232
235
238
241
244
247
250
253
256};
257
258/*
259 * @enum bt_ots_oacp_write_op_mode
260 * @brief Mode Parameter for OACP Write Op Code.
261 */
266
271#define BT_OTS_OACP_SET_FEAT_CREATE(feat) \
272 WRITE_BIT(feat, BT_OTS_OACP_FEAT_CREATE, 1)
273
278#define BT_OTS_OACP_SET_FEAT_DELETE(feat) \
279 WRITE_BIT(feat, BT_OTS_OACP_FEAT_DELETE, 1)
280
285#define BT_OTS_OACP_SET_FEAT_CHECKSUM(feat) \
286 WRITE_BIT(feat, BT_OTS_OACP_FEAT_CHECKSUM, 1)
287
292#define BT_OTS_OACP_SET_FEAT_EXECUTE(feat) \
293 WRITE_BIT(feat, BT_OTS_OACP_FEAT_EXECUTE, 1)
294
299#define BT_OTS_OACP_SET_FEAT_READ(feat) \
300 WRITE_BIT(feat, BT_OTS_OACP_FEAT_READ, 1)
301
306#define BT_OTS_OACP_SET_FEAT_WRITE(feat) \
307 WRITE_BIT(feat, BT_OTS_OACP_FEAT_WRITE, 1)
308
313#define BT_OTS_OACP_SET_FEAT_APPEND(feat) \
314 WRITE_BIT(feat, BT_OTS_OACP_FEAT_APPEND, 1)
315
320#define BT_OTS_OACP_SET_FEAT_TRUNCATE(feat) \
321 WRITE_BIT(feat, BT_OTS_OACP_FEAT_TRUNCATE, 1)
322
327#define BT_OTS_OACP_SET_FEAT_PATCH(feat) \
328 WRITE_BIT(feat, BT_OTS_OACP_FEAT_PATCH, 1)
329
334#define BT_OTS_OACP_SET_FEAT_ABORT(feat) \
335 WRITE_BIT(feat, BT_OTS_OACP_FEAT_ABORT, 1)
336
341#define BT_OTS_OACP_GET_FEAT_CREATE(feat) \
342 ((feat) & BIT(BT_OTS_OACP_FEAT_CREATE))
343
348#define BT_OTS_OACP_GET_FEAT_DELETE(feat) \
349 ((feat) & BIT(BT_OTS_OACP_FEAT_DELETE))
350
355#define BT_OTS_OACP_GET_FEAT_CHECKSUM(feat) \
356 ((feat) & BIT(BT_OTS_OACP_FEAT_CHECKSUM))
357
362#define BT_OTS_OACP_GET_FEAT_EXECUTE(feat) \
363 ((feat) & BIT(BT_OTS_OACP_FEAT_EXECUTE))
364
369#define BT_OTS_OACP_GET_FEAT_READ(feat) \
370 ((feat) & BIT(BT_OTS_OACP_FEAT_READ))
371
376#define BT_OTS_OACP_GET_FEAT_WRITE(feat) \
377 ((feat) & BIT(BT_OTS_OACP_FEAT_WRITE))
378
383#define BT_OTS_OACP_GET_FEAT_APPEND(feat) \
384 ((feat) & BIT(BT_OTS_OACP_FEAT_APPEND))
385
390#define BT_OTS_OACP_GET_FEAT_TRUNCATE(feat) \
391 ((feat) & BIT(BT_OTS_OACP_FEAT_TRUNCATE))
392
397#define BT_OTS_OACP_GET_FEAT_PATCH(feat) \
398 ((feat) & BIT(BT_OTS_OACP_FEAT_PATCH))
399
404#define BT_OTS_OACP_GET_FEAT_ABORT(feat) \
405 ((feat) & BIT(BT_OTS_OACP_FEAT_ABORT))
406
408enum {
411
414
417
420};
421
426#define BT_OTS_OLCP_SET_FEAT_GO_TO(feat) \
427 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_GO_TO, 1)
428
433#define BT_OTS_OLCP_SET_FEAT_ORDER(feat) \
434 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_ORDER, 1)
435
440#define BT_OTS_OLCP_SET_FEAT_NUM_REQ(feat) \
441 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_NUM_REQ, 1)
442
447#define BT_OTS_OLCP_SET_FEAT_CLEAR(feat) \
448 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_CLEAR, 1)
449
454#define BT_OTS_OLCP_GET_FEAT_GO_TO(feat) \
455 ((feat) & BIT(BT_OTS_OLCP_FEAT_GO_TO))
456
461#define BT_OTS_OLCP_GET_FEAT_ORDER(feat) \
462 ((feat) & BIT(BT_OTS_OLCP_FEAT_ORDER))
463
468#define BT_OTS_OLCP_GET_FEAT_NUM_REQ(feat) \
469 ((feat) & BIT(BT_OTS_OLCP_FEAT_NUM_REQ))
470
475#define BT_OTS_OLCP_GET_FEAT_CLEAR(feat) \
476 ((feat) & BIT(BT_OTS_OLCP_FEAT_CLEAR))
477
480 /* OACP Features */
482
483 /* OLCP Features */
485} __packed;
486
488enum {
505};
506
516#define BT_OTS_DATE_TIME_FIELD_SIZE 7
517
524
525#if defined(CONFIG_BT_OTS) || defined(__DOXYGEN__)
527 char *name;
528#endif /* CONFIG_BT_OTS */
529
530#if defined(CONFIG_BT_OTS_CLIENT) || defined(__DOXYGEN__)
531 /* TODO: Unify client/server name */
533 char name_c[CONFIG_BT_OTS_OBJ_MAX_NAME_LEN + 1];
534#endif /* CONFIG_BT_OTS_CLIENT */
535
538
541
542#if defined(CONFIG_BT_OTS_CLIENT) || defined(__DOXYGEN__)
545
548
551#endif /* CONFIG_BT_OTS_CLIENT */
552
555};
556
561struct bt_ots;
562
571
604
606struct bt_ots_cb {
629 int (*obj_created)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id,
630 const struct bt_ots_obj_add_param *add_param,
631 struct bt_ots_obj_created_desc *created_desc);
632
654 int (*obj_deleted)(struct bt_ots *ots, struct bt_conn *conn,
655 uint64_t id);
656
665 void (*obj_selected)(struct bt_ots *ots, struct bt_conn *conn,
666 uint64_t id);
667
688 ssize_t (*obj_read)(struct bt_ots *ots, struct bt_conn *conn,
689 uint64_t id, void **data, size_t len,
690 off_t offset);
691
718 ssize_t (*obj_write)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id,
719 const void *data, size_t len, off_t offset,
720 size_t rem);
721
734 void (*obj_name_written)(struct bt_ots *ots, struct bt_conn *conn,
735 uint64_t id, const char *cur_name, const char *new_name);
736
752 int (*obj_cal_checksum)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id,
753 off_t offset, size_t len, void **data);
754};
755
758 /* OTS features */
760
761 /* Callbacks */
762 struct bt_ots_cb *cb;
763};
764
777int bt_ots_obj_add(struct bt_ots *ots, const struct bt_ots_obj_add_param *param);
778
791int bt_ots_obj_delete(struct bt_ots *ots, uint64_t id);
792
802void *bt_ots_svc_decl_get(struct bt_ots *ots);
803
811int bt_ots_init(struct bt_ots *ots, struct bt_ots_init_param *ots_init);
812
818
819#define BT_OTS_STOP 0
820#define BT_OTS_CONTINUE 1
821
822/* TODO: Merge server and client instance as opaque type */
851
865 void (*obj_selected)(struct bt_ots_client *ots_inst,
866 struct bt_conn *conn, int err);
867
868
885 int (*obj_data_read)(struct bt_ots_client *ots_inst,
886 struct bt_conn *conn, uint32_t offset,
887 uint32_t len, uint8_t *data_p, bool is_complete);
888
902 void (*obj_metadata_read)(struct bt_ots_client *ots_inst,
903 struct bt_conn *conn, int err,
904 uint8_t metadata_read);
905
915 void (*obj_data_written)(struct bt_ots_client *ots_inst,
916 struct bt_conn *conn, size_t len);
917
929 void (*obj_checksum_calculated)(struct bt_ots_client *ots_inst, struct bt_conn *conn,
930 int err, uint32_t checksum);
931};
932
944
955
968 struct bt_gatt_subscribe_params *params,
969 const void *data, uint16_t length);
970
979 struct bt_conn *conn);
980
990 struct bt_conn *conn,
991 uint64_t obj_id);
992
1001 struct bt_conn *conn);
1002
1011 struct bt_conn *conn);
1012
1021 struct bt_conn *conn);
1022
1031 struct bt_conn *conn);
1032
1045 struct bt_conn *conn,
1046 uint8_t metadata);
1047
1061 struct bt_conn *conn);
1062
1079int bt_ots_client_write_object_data(struct bt_ots_client *otc_inst, struct bt_conn *conn,
1080 const void *buf, size_t len, off_t offset,
1081 enum bt_ots_oacp_write_op_mode mode);
1082
1099 off_t offset, size_t len);
1100
1112
1124
1136static inline int bt_ots_obj_id_to_str(uint64_t obj_id, char *str, size_t len)
1137{
1138 uint8_t id[6];
1139
1140 sys_put_le48(obj_id, id);
1141
1142 return snprintk(str, len, "0x%02X%02X%02X%02X%02X%02X",
1143 id[5], id[4], id[3], id[2], id[1], id[0]);
1144}
1145
1152 uint16_t count);
1153
1165static inline uint32_t bt_ots_client_calc_checksum(const uint8_t *data, size_t len)
1166{
1167 return crc32_ieee(data, len);
1168}
1169
1170#ifdef __cplusplus
1171}
1172#endif
1173
1177
1178#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTS_H_ */
Bluetooth UUID handling.
Bluetooth connection handling.
Generic Attribute Profile handling.
int bt_ots_init(struct bt_ots *ots, struct bt_ots_init_param *ots_init)
Initialize the OTS instance.
int bt_ots_client_select_id(struct bt_ots_client *otc_inst, struct bt_conn *conn, uint64_t obj_id)
Select an object by its Object ID.
static uint32_t bt_ots_client_calc_checksum(const uint8_t *data, size_t len)
Generate IEEE conform CRC32 checksum.
Definition ots.h:1165
int bt_ots_client_select_first(struct bt_ots_client *otc_inst, struct bt_conn *conn)
Select the first object.
int bt_ots_client_select_next(struct bt_ots_client *otc_inst, struct bt_conn *conn)
Select the next object.
void bt_ots_metadata_display(struct bt_ots_obj_metadata *metadata, uint16_t count)
Displays one or more object metadata as text with LOG_INF.
int bt_ots_obj_delete(struct bt_ots *ots, uint64_t id)
Delete an object from the OTS instance.
int bt_ots_client_select_last(struct bt_ots_client *otc_inst, struct bt_conn *conn)
Select the last object.
int bt_ots_client_read_object_data(struct bt_ots_client *otc_inst, struct bt_conn *conn)
Read the data of the current selected object.
int bt_ots_client_read_object_metadata(struct bt_ots_client *otc_inst, struct bt_conn *conn, uint8_t metadata)
Read the metadata of the current object.
int bt_ots_client_write_object_data(struct bt_ots_client *otc_inst, struct bt_conn *conn, const void *buf, size_t len, off_t offset, enum bt_ots_oacp_write_op_mode mode)
Write the data of the current selected object.
int bt_ots_client_get_object_checksum(struct bt_ots_client *otc_inst, struct bt_conn *conn, off_t offset, size_t len)
Get the checksum of the current selected object.
int(* bt_ots_client_dirlisting_cb)(struct bt_ots_obj_metadata *meta)
Directory listing object metadata callback.
Definition ots.h:1111
int bt_ots_client_unregister(uint8_t index)
Unregister an Object Transfer Service Instance.
int bt_ots_client_decode_dirlisting(uint8_t *data, uint16_t length, bt_ots_client_dirlisting_cb cb)
Decode Directory Listing object into object metadata.
void * bt_ots_svc_decl_get(struct bt_ots *ots)
Get the service declaration attribute.
int bt_ots_obj_add(struct bt_ots *ots, const struct bt_ots_obj_add_param *param)
Add an object to the OTS instance.
uint8_t bt_ots_client_indicate_handler(struct bt_conn *conn, struct bt_gatt_subscribe_params *params, const void *data, uint16_t length)
OTS Indicate Handler function.
int bt_ots_client_select_prev(struct bt_ots_client *otc_inst, struct bt_conn *conn)
Select the previous object.
static int bt_ots_obj_id_to_str(uint64_t obj_id, char *str, size_t len)
Converts binary OTS Object ID to string.
Definition ots.h:1136
int bt_ots_client_register(struct bt_ots_client *ots_inst)
Register an Object Transfer Service Instance.
bt_ots_oacp_write_op_mode
Definition ots.h:262
int bt_ots_client_read_feature(struct bt_ots_client *otc_inst, struct bt_conn *conn)
Read the OTS feature characteristic.
struct bt_ots * bt_ots_free_instance_get(void)
Get a free instance of OTS from the pool.
@ BT_OTS_METADATA_REQ_ALL
Request all object metadata.
Definition ots.h:504
@ BT_OTS_METADATA_REQ_MODIFIED
Request object last modified time.
Definition ots.h:498
@ BT_OTS_METADATA_REQ_ID
Request object ID.
Definition ots.h:500
@ BT_OTS_METADATA_REQ_CREATED
Request object first created time.
Definition ots.h:496
@ BT_OTS_METADATA_REQ_SIZE
Request object size.
Definition ots.h:494
@ BT_OTS_METADATA_REQ_NAME
Request object name.
Definition ots.h:490
@ BT_OTS_METADATA_REQ_PROPS
Request object properties.
Definition ots.h:502
@ BT_OTS_METADATA_REQ_TYPE
Request object type.
Definition ots.h:492
@ BT_OTS_OBJ_PROP_MARKED
Bit 7 This object is a marked object.
Definition ots.h:101
@ BT_OTS_OBJ_PROP_DELETE
Bit 0 Deletion of this object is permitted.
Definition ots.h:73
@ BT_OTS_OBJ_PROP_TRUNCATE
Bit 5 Truncation of this object is permitted.
Definition ots.h:91
@ BT_OTS_OBJ_PROP_APPEND
Bit 4 Appending data to this object is permitted.
Definition ots.h:88
@ BT_OTS_OBJ_PROP_READ
Bit 2 Reading this object is permitted.
Definition ots.h:79
@ BT_OTS_OBJ_PROP_EXECUTE
Bit 1 Execution of this object is permitted.
Definition ots.h:76
@ BT_OTS_OBJ_PROP_PATCH
Bit 6 Patching this object is permitted.
Definition ots.h:98
@ BT_OTS_OBJ_PROP_WRITE
Bit 3 Writing data to this object is permitted.
Definition ots.h:82
@ BT_OTS_OACP_FEAT_ABORT
Bit 9 OACP Abort Op Code Supported.
Definition ots.h:255
@ BT_OTS_OACP_FEAT_DELETE
Bit 1 OACP Delete Op Code Supported.
Definition ots.h:231
@ BT_OTS_OACP_FEAT_APPEND
Bit 6 Appending Additional Data to Objects Supported.
Definition ots.h:246
@ BT_OTS_OACP_FEAT_READ
Bit 4 OACP Read Op Code Supported.
Definition ots.h:240
@ BT_OTS_OACP_FEAT_TRUNCATE
Bit 7 Truncation of Objects Supported.
Definition ots.h:249
@ BT_OTS_OACP_FEAT_CHECKSUM
Bit 2 OACP Calculate Checksum Op Code Supported.
Definition ots.h:234
@ BT_OTS_OACP_FEAT_WRITE
Bit 5 OACP Write Op Code Supported.
Definition ots.h:243
@ BT_OTS_OACP_FEAT_EXECUTE
Bit 3 OACP Execute Op Code Supported.
Definition ots.h:237
@ BT_OTS_OACP_FEAT_PATCH
Bit 8 Patching of Objects Supported.
Definition ots.h:252
@ BT_OTS_OACP_FEAT_CREATE
Bit 0 OACP Create Op Code Supported.
Definition ots.h:228
@ BT_OTS_OLCP_FEAT_ORDER
Bit 1 OLCP Order Op Code Supported.
Definition ots.h:413
@ BT_OTS_OLCP_FEAT_NUM_REQ
Bit 2 OLCP Request Number of Objects Op Code Supported.
Definition ots.h:416
@ BT_OTS_OLCP_FEAT_CLEAR
Bit 3 OLCP Clear Marking Op Code Supported.
Definition ots.h:419
@ BT_OTS_OLCP_FEAT_GO_TO
Bit 0 OLCP Go To Op Code Supported.
Definition ots.h:410
@ BT_OTS_OACP_WRITE_OP_MODE_NONE
Definition ots.h:263
@ BT_OTS_OACP_WRITE_OP_MODE_TRUNCATE
Definition ots.h:264
uint32_t crc32_ieee(const uint8_t *data, size_t len)
Generate IEEE conform CRC32 checksum.
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
__SIZE_TYPE__ ssize_t
Definition types.h:28
__INTPTR_TYPE__ off_t
Definition types.h:36
int snprintk(char *str, size_t size, const char *fmt,...)
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Opaque type representing a connection to a remote device.
GATT Discover Attributes parameters.
Definition gatt.h:1863
GATT Read parameters.
Definition gatt.h:1961
GATT Subscribe parameters.
Definition gatt.h:2260
GATT Write parameters.
Definition gatt.h:2084
OTS callback structure.
Definition ots.h:606
int(* obj_created)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id, const struct bt_ots_obj_add_param *add_param, struct bt_ots_obj_created_desc *created_desc)
Object created callback.
Definition ots.h:629
int(* obj_cal_checksum)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id, off_t offset, size_t len, void **data)
Object Calculate checksum callback.
Definition ots.h:752
int(* obj_deleted)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id)
Object deleted callback.
Definition ots.h:654
void(* obj_name_written)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id, const char *cur_name, const char *new_name)
Object name written callback.
Definition ots.h:734
ssize_t(* obj_read)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id, void **data, size_t len, off_t offset)
Object read callback.
Definition ots.h:688
ssize_t(* obj_write)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id, const void *data, size_t len, off_t offset, size_t rem)
Object write callback.
Definition ots.h:718
void(* obj_selected)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id)
Object selected callback.
Definition ots.h:665
OTS client callback structure.
Definition ots.h:853
void(* obj_data_written)(struct bt_ots_client *ots_inst, struct bt_conn *conn, size_t len)
Callback function for the data of the write object.
Definition ots.h:915
void(* obj_metadata_read)(struct bt_ots_client *ots_inst, struct bt_conn *conn, int err, uint8_t metadata_read)
Callback function for metadata of the selected object.
Definition ots.h:902
void(* obj_selected)(struct bt_ots_client *ots_inst, struct bt_conn *conn, int err)
Callback function when a new object is selected.
Definition ots.h:865
void(* obj_checksum_calculated)(struct bt_ots_client *ots_inst, struct bt_conn *conn, int err, uint32_t checksum)
Callback function when checksum indication is received.
Definition ots.h:929
int(* obj_data_read)(struct bt_ots_client *ots_inst, struct bt_conn *conn, uint32_t offset, uint32_t len, uint8_t *data_p, bool is_complete)
Callback function for the data of the selected object.
Definition ots.h:885
OTS client instance.
Definition ots.h:824
struct bt_gatt_write_params write_params
Definition ots.h:843
uint16_t start_handle
Definition ots.h:825
struct bt_ots_client_cb * cb
Definition ots.h:845
uint16_t feature_handle
Definition ots.h:827
uint16_t obj_id_handle
Definition ots.h:834
struct bt_gatt_subscribe_params olcp_sub_params
Definition ots.h:840
uint16_t obj_size_handle
Definition ots.h:830
uint16_t obj_modified_handle
Definition ots.h:833
struct bt_gatt_read_params read_proc
Definition ots.h:844
struct bt_gatt_discover_params oacp_sub_disc_params
Definition ots.h:839
struct bt_ots_feat features
Definition ots.h:847
struct bt_gatt_subscribe_params oacp_sub_params
Definition ots.h:838
uint16_t end_handle
Definition ots.h:826
uint16_t olcp_handle
Definition ots.h:836
uint16_t obj_properties_handle
Definition ots.h:831
struct bt_ots_obj_metadata cur_object
Definition ots.h:849
struct bt_gatt_discover_params olcp_sub_disc_params
Definition ots.h:841
uint16_t oacp_handle
Definition ots.h:835
uint16_t obj_type_handle
Definition ots.h:829
uint16_t obj_name_handle
Definition ots.h:828
uint16_t obj_created_handle
Definition ots.h:832
Date and Time structure.
Definition ots.h:508
uint8_t day
Definition ots.h:511
uint8_t seconds
Definition ots.h:514
uint8_t month
Definition ots.h:510
uint8_t minutes
Definition ots.h:513
uint8_t hours
Definition ots.h:512
uint16_t year
Definition ots.h:509
Features of the OTS.
Definition ots.h:479
uint32_t olcp
Definition ots.h:484
uint32_t oacp
Definition ots.h:481
Descriptor for OTS initialization.
Definition ots.h:757
struct bt_ots_cb * cb
Definition ots.h:762
struct bt_ots_feat features
Definition ots.h:759
Descriptor for OTS object addition.
Definition ots.h:564
uint32_t size
Object size to allocate.
Definition ots.h:566
struct bt_ots_obj_type type
Object type.
Definition ots.h:569
Descriptor for OTS created object.
Definition ots.h:578
uint32_t props
Object properties.
Definition ots.h:602
struct bt_ots_obj_size size
Object size.
Definition ots.h:599
char * name
Object name.
Definition ots.h:588
Metadata of an OTS object.
Definition ots.h:523
char * name
Object Name.
Definition ots.h:527
struct bt_ots_date_time first_created
Object first created time.
Definition ots.h:544
struct bt_ots_date_time modified
Object last modified time.
Definition ots.h:547
uint32_t props
Object Properties.
Definition ots.h:554
uint64_t id
Object ID.
Definition ots.h:550
char name_c[CONFIG_BT_OTS_OBJ_MAX_NAME_LEN+1]
Object name (client).
Definition ots.h:533
struct bt_ots_obj_type type
Object Type.
Definition ots.h:537
struct bt_ots_obj_size size
Object Size.
Definition ots.h:540
Descriptor for OTS Object Size parameter.
Definition ots.h:217
uint32_t cur
Current Size.
Definition ots.h:219
uint32_t alloc
Allocated Size.
Definition ots.h:222
Type of an OTS object.
Definition ots.h:57
struct bt_uuid uuid
Definition ots.h:60
struct bt_uuid_16 uuid_16
Definition ots.h:63
struct bt_uuid_128 uuid_128
Definition ots.h:66
Opaque OTS instance.
Definition uuid.h:70
Definition uuid.h:56
This is a 'tentative' type and should be used as a pointer only.
Definition uuid.h:52
Byte order helpers.
static void sys_put_le48(uint64_t val, uint8_t dst[6])
Put a 48-bit integer as little-endian to arbitrary location.
Definition byteorder.h:492
CRC computation function.
Misc utilities.