Zephyr API Documentation 4.0.0
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
20#include <stdbool.h>
21#include <stdint.h>
22
23#include <sys/types.h>
24
26#include <zephyr/sys/util.h>
27#include <zephyr/sys/crc.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
37#define BT_OTS_OBJ_ID_SIZE 6
38
40#define BT_OTS_OBJ_ID_MIN 0x000000000100ULL
41
43#define BT_OTS_OBJ_ID_MAX 0xFFFFFFFFFFFFULL
44
46#define OTS_OBJ_ID_DIR_LIST 0x000000000000ULL
47
49#define BT_OTS_OBJ_ID_MASK BIT64_MASK(48)
50
52#define BT_OTS_OBJ_ID_STR_LEN 15
53
56 union {
57 /* Used to indicate UUID type */
58 struct bt_uuid uuid;
59
60 /* 16-bit UUID value */
62
63 /* 128-bit UUID value */
65 };
66};
67
69enum {
72
75
78
81
87
90
97
100};
101
106#define BT_OTS_OBJ_SET_PROP_DELETE(prop) \
107 WRITE_BIT(prop, BT_OTS_OBJ_PROP_DELETE, 1)
108
113#define BT_OTS_OBJ_SET_PROP_EXECUTE(prop) \
114 WRITE_BIT(prop, BT_OTS_OBJ_PROP_EXECUTE, 1)
115
120#define BT_OTS_OBJ_SET_PROP_READ(prop) \
121 WRITE_BIT(prop, BT_OTS_OBJ_PROP_READ, 1)
122
127#define BT_OTS_OBJ_SET_PROP_WRITE(prop) \
128 WRITE_BIT(prop, BT_OTS_OBJ_PROP_WRITE, 1)
129
134#define BT_OTS_OBJ_SET_PROP_APPEND(prop) \
135 WRITE_BIT(prop, BT_OTS_OBJ_PROP_APPEND, 1)
136
141#define BT_OTS_OBJ_SET_PROP_TRUNCATE(prop) \
142 WRITE_BIT(prop, BT_OTS_OBJ_PROP_TRUNCATE, 1)
143
148#define BT_OTS_OBJ_SET_PROP_PATCH(prop) \
149 WRITE_BIT(prop, BT_OTS_OBJ_PROP_PATCH, 1)
150
155#define BT_OTS_OBJ_SET_PROP_MARKED(prop) \
156 WRITE_BIT(prop, BT_OTS_OBJ_PROP_MARKED, 1)
157
162#define BT_OTS_OBJ_GET_PROP_DELETE(prop) \
163 ((prop) & BIT(BT_OTS_OBJ_PROP_DELETE))
164
169#define BT_OTS_OBJ_GET_PROP_EXECUTE(prop) \
170 ((prop) & BIT(BT_OTS_OBJ_PROP_EXECUTE))
171
176#define BT_OTS_OBJ_GET_PROP_READ(prop) \
177 ((prop) & BIT(BT_OTS_OBJ_PROP_READ))
178
183#define BT_OTS_OBJ_GET_PROP_WRITE(prop) \
184 ((prop) & BIT(BT_OTS_OBJ_PROP_WRITE))
185
190#define BT_OTS_OBJ_GET_PROP_APPEND(prop) \
191 ((prop) & BIT(BT_OTS_OBJ_PROP_APPEND))
192
197#define BT_OTS_OBJ_GET_PROP_TRUNCATE(prop) \
198 ((prop) & BIT(BT_OTS_OBJ_PROP_TRUNCATE))
199
204#define BT_OTS_OBJ_GET_PROP_PATCH(prop) \
205 ((prop) & BIT(BT_OTS_OBJ_PROP_PATCH))
206
211#define BT_OTS_OBJ_GET_PROP_MARKED(prop) \
212 ((prop) & BIT(BT_OTS_OBJ_PROP_MARKED))
213
218
221} __packed;
222
224enum {
227
230
233
236
239
242
245
248
251
254};
255
256/*
257 * @enum bt_ots_oacp_write_op_mode
258 * @brief Mode Parameter for OACP Write Op Code.
259 */
264
269#define BT_OTS_OACP_SET_FEAT_CREATE(feat) \
270 WRITE_BIT(feat, BT_OTS_OACP_FEAT_CREATE, 1)
271
276#define BT_OTS_OACP_SET_FEAT_DELETE(feat) \
277 WRITE_BIT(feat, BT_OTS_OACP_FEAT_DELETE, 1)
278
283#define BT_OTS_OACP_SET_FEAT_CHECKSUM(feat) \
284 WRITE_BIT(feat, BT_OTS_OACP_FEAT_CHECKSUM, 1)
285
290#define BT_OTS_OACP_SET_FEAT_EXECUTE(feat) \
291 WRITE_BIT(feat, BT_OTS_OACP_FEAT_EXECUTE, 1)
292
297#define BT_OTS_OACP_SET_FEAT_READ(feat) \
298 WRITE_BIT(feat, BT_OTS_OACP_FEAT_READ, 1)
299
304#define BT_OTS_OACP_SET_FEAT_WRITE(feat) \
305 WRITE_BIT(feat, BT_OTS_OACP_FEAT_WRITE, 1)
306
311#define BT_OTS_OACP_SET_FEAT_APPEND(feat) \
312 WRITE_BIT(feat, BT_OTS_OACP_FEAT_APPEND, 1)
313
318#define BT_OTS_OACP_SET_FEAT_TRUNCATE(feat) \
319 WRITE_BIT(feat, BT_OTS_OACP_FEAT_TRUNCATE, 1)
320
325#define BT_OTS_OACP_SET_FEAT_PATCH(feat) \
326 WRITE_BIT(feat, BT_OTS_OACP_FEAT_PATCH, 1)
327
332#define BT_OTS_OACP_SET_FEAT_ABORT(feat) \
333 WRITE_BIT(feat, BT_OTS_OACP_FEAT_ABORT, 1)
334
339#define BT_OTS_OACP_GET_FEAT_CREATE(feat) \
340 ((feat) & BIT(BT_OTS_OACP_FEAT_CREATE))
341
346#define BT_OTS_OACP_GET_FEAT_DELETE(feat) \
347 ((feat) & BIT(BT_OTS_OACP_FEAT_DELETE))
348
353#define BT_OTS_OACP_GET_FEAT_CHECKSUM(feat) \
354 ((feat) & BIT(BT_OTS_OACP_FEAT_CHECKSUM))
355
360#define BT_OTS_OACP_GET_FEAT_EXECUTE(feat) \
361 ((feat) & BIT(BT_OTS_OACP_FEAT_EXECUTE))
362
367#define BT_OTS_OACP_GET_FEAT_READ(feat) \
368 ((feat) & BIT(BT_OTS_OACP_FEAT_READ))
369
374#define BT_OTS_OACP_GET_FEAT_WRITE(feat) \
375 ((feat) & BIT(BT_OTS_OACP_FEAT_WRITE))
376
381#define BT_OTS_OACP_GET_FEAT_APPEND(feat) \
382 ((feat) & BIT(BT_OTS_OACP_FEAT_APPEND))
383
388#define BT_OTS_OACP_GET_FEAT_TRUNCATE(feat) \
389 ((feat) & BIT(BT_OTS_OACP_FEAT_TRUNCATE))
390
395#define BT_OTS_OACP_GET_FEAT_PATCH(feat) \
396 ((feat) & BIT(BT_OTS_OACP_FEAT_PATCH))
397
402#define BT_OTS_OACP_GET_FEAT_ABORT(feat) \
403 ((feat) & BIT(BT_OTS_OACP_FEAT_ABORT))
404
406enum {
409
412
415
418};
419
424#define BT_OTS_OLCP_SET_FEAT_GO_TO(feat) \
425 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_GO_TO, 1)
426
431#define BT_OTS_OLCP_SET_FEAT_ORDER(feat) \
432 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_ORDER, 1)
433
438#define BT_OTS_OLCP_SET_FEAT_NUM_REQ(feat) \
439 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_NUM_REQ, 1)
440
445#define BT_OTS_OLCP_SET_FEAT_CLEAR(feat) \
446 WRITE_BIT(feat, BT_OTS_OLCP_FEAT_CLEAR, 1)
447
452#define BT_OTS_OLCP_GET_FEAT_GO_TO(feat) \
453 ((feat) & BIT(BT_OTS_OLCP_FEAT_GO_TO))
454
459#define BT_OTS_OLCP_GET_FEAT_ORDER(feat) \
460 ((feat) & BIT(BT_OTS_OLCP_FEAT_ORDER))
461
466#define BT_OTS_OLCP_GET_FEAT_NUM_REQ(feat) \
467 ((feat) & BIT(BT_OTS_OLCP_FEAT_NUM_REQ))
468
473#define BT_OTS_OLCP_GET_FEAT_CLEAR(feat) \
474 ((feat) & BIT(BT_OTS_OLCP_FEAT_CLEAR))
475
478 /* OACP Features */
480
481 /* OLCP Features */
483} __packed;
484
486enum {
503};
504
514#define BT_OTS_DATE_TIME_FIELD_SIZE 7
515
522
523#if defined(CONFIG_BT_OTS)
525 char *name;
526#endif /* CONFIG_BT_OTS */
527
528#if defined(CONFIG_BT_OTS_CLIENT)
529 /* TODO: Unify client/server name */
531 char name_c[CONFIG_BT_OTS_OBJ_MAX_NAME_LEN + 1];
532#endif /* CONFIG_BT_OTS_CLIENT */
533
536
539
540#if defined(CONFIG_BT_OTS_CLIENT)
542 struct bt_ots_date_time first_created;
543
545 struct bt_ots_date_time modified;
546
548 uint64_t id;
549#endif /* CONFIG_BT_OTS_CLIENT */
550
553};
554
556struct bt_ots;
557
566
599
601struct bt_ots_cb {
624 int (*obj_created)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id,
625 const struct bt_ots_obj_add_param *add_param,
626 struct bt_ots_obj_created_desc *created_desc);
627
649 int (*obj_deleted)(struct bt_ots *ots, struct bt_conn *conn,
650 uint64_t id);
651
660 void (*obj_selected)(struct bt_ots *ots, struct bt_conn *conn,
661 uint64_t id);
662
683 ssize_t (*obj_read)(struct bt_ots *ots, struct bt_conn *conn,
684 uint64_t id, void **data, size_t len,
685 off_t offset);
686
713 ssize_t (*obj_write)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id,
714 const void *data, size_t len, off_t offset,
715 size_t rem);
716
729 void (*obj_name_written)(struct bt_ots *ots, struct bt_conn *conn,
730 uint64_t id, const char *cur_name, const char *new_name);
731
747 int (*obj_cal_checksum)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id,
748 off_t offset, size_t len, void **data);
749};
750
753 /* OTS features */
755
756 /* Callbacks */
757 struct bt_ots_cb *cb;
758};
759
772int bt_ots_obj_add(struct bt_ots *ots, const struct bt_ots_obj_add_param *param);
773
786int bt_ots_obj_delete(struct bt_ots *ots, uint64_t id);
787
797void *bt_ots_svc_decl_get(struct bt_ots *ots);
798
806int bt_ots_init(struct bt_ots *ots, struct bt_ots_init_param *ots_init);
807
812struct bt_ots *bt_ots_free_instance_get(void);
813
814#define BT_OTS_STOP 0
815#define BT_OTS_CONTINUE 1
816
817/* TODO: Merge server and client instance as opaque type */
846
860 void (*obj_selected)(struct bt_ots_client *ots_inst,
861 struct bt_conn *conn, int err);
862
863
880 int (*obj_data_read)(struct bt_ots_client *ots_inst,
881 struct bt_conn *conn, uint32_t offset,
882 uint32_t len, uint8_t *data_p, bool is_complete);
883
897 void (*obj_metadata_read)(struct bt_ots_client *ots_inst,
898 struct bt_conn *conn, int err,
899 uint8_t metadata_read);
900
910 void (*obj_data_written)(struct bt_ots_client *ots_inst,
911 struct bt_conn *conn, size_t len);
912
924 void (*obj_checksum_calculated)(struct bt_ots_client *ots_inst, struct bt_conn *conn,
925 int err, uint32_t checksum);
926};
927
939
950
963 struct bt_gatt_subscribe_params *params,
964 const void *data, uint16_t length);
965
974 struct bt_conn *conn);
975
985 struct bt_conn *conn,
986 uint64_t obj_id);
987
996 struct bt_conn *conn);
997
1006 struct bt_conn *conn);
1007
1016 struct bt_conn *conn);
1017
1026 struct bt_conn *conn);
1027
1040 struct bt_conn *conn,
1041 uint8_t metadata);
1042
1056 struct bt_conn *conn);
1057
1074int bt_ots_client_write_object_data(struct bt_ots_client *otc_inst, struct bt_conn *conn,
1075 const void *buf, size_t len, off_t offset,
1076 enum bt_ots_oacp_write_op_mode mode);
1077
1093int bt_ots_client_get_object_checksum(struct bt_ots_client *otc_inst, struct bt_conn *conn,
1094 off_t offset, size_t len);
1095
1107
1119
1131static inline int bt_ots_obj_id_to_str(uint64_t obj_id, char *str, size_t len)
1132{
1133 uint8_t id[6];
1134
1135 sys_put_le48(obj_id, id);
1136
1137 return snprintk(str, len, "0x%02X%02X%02X%02X%02X%02X",
1138 id[5], id[4], id[3], id[2], id[1], id[0]);
1139}
1140
1147 uint16_t count);
1148
1160#if defined(CONFIG_BT_OTS_OACP_CHECKSUM_SUPPORT)
1161static inline uint32_t bt_ots_client_calc_checksum(const uint8_t *data, size_t len)
1162{
1163 return crc32_ieee(data, len);
1164}
1165#endif
1166
1167#ifdef __cplusplus
1168}
1169#endif
1170
1175#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_OTS_H_ */
Bluetooth connection handling.
CRC computation function.
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.
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:1106
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:1131
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:260
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_OBJ_PROP_MARKED
Bit 7 This object is a marked object.
Definition ots.h:99
@ BT_OTS_OBJ_PROP_DELETE
Bit 0 Deletion of this object is permitted.
Definition ots.h:71
@ BT_OTS_OBJ_PROP_TRUNCATE
Bit 5 Truncation of this object is permitted.
Definition ots.h:89
@ BT_OTS_OBJ_PROP_APPEND
Bit 4 Appending data to this object is permitted.
Definition ots.h:86
@ BT_OTS_OBJ_PROP_READ
Bit 2 Reading this object is permitted.
Definition ots.h:77
@ BT_OTS_OBJ_PROP_EXECUTE
Bit 1 Execution of this object is permitted.
Definition ots.h:74
@ BT_OTS_OBJ_PROP_PATCH
Bit 6 Patching this object is permitted.
Definition ots.h:96
@ BT_OTS_OBJ_PROP_WRITE
Bit 3 Writing data to this object is permitted.
Definition ots.h:80
@ BT_OTS_OLCP_FEAT_ORDER
Bit 1 OLCP Order Op Code Supported.
Definition ots.h:411
@ BT_OTS_OLCP_FEAT_NUM_REQ
Bit 2 OLCP Request Number of Objects Op Code Supported.
Definition ots.h:414
@ BT_OTS_OLCP_FEAT_CLEAR
Bit 3 OLCP Clear Marking Op Code Supported.
Definition ots.h:417
@ BT_OTS_OLCP_FEAT_GO_TO
Bit 0 OLCP Go To Op Code Supported.
Definition ots.h:408
@ BT_OTS_METADATA_REQ_ALL
Request all object metadata.
Definition ots.h:502
@ BT_OTS_METADATA_REQ_MODIFIED
Request object last modified time.
Definition ots.h:496
@ BT_OTS_METADATA_REQ_ID
Request object ID.
Definition ots.h:498
@ BT_OTS_METADATA_REQ_CREATED
Request object first created time.
Definition ots.h:494
@ BT_OTS_METADATA_REQ_SIZE
Request object size.
Definition ots.h:492
@ BT_OTS_METADATA_REQ_NAME
Request object name.
Definition ots.h:488
@ BT_OTS_METADATA_REQ_PROPS
Request object properties.
Definition ots.h:500
@ BT_OTS_METADATA_REQ_TYPE
Request object type.
Definition ots.h:490
@ BT_OTS_OACP_FEAT_ABORT
Bit 9 OACP Abort Op Code Supported.
Definition ots.h:253
@ BT_OTS_OACP_FEAT_DELETE
Bit 1 OACP Delete Op Code Supported
Definition ots.h:229
@ BT_OTS_OACP_FEAT_APPEND
Bit 6 Appending Additional Data to Objects Supported
Definition ots.h:244
@ BT_OTS_OACP_FEAT_READ
Bit 4 OACP Read Op Code Supported.
Definition ots.h:238
@ BT_OTS_OACP_FEAT_TRUNCATE
Bit 7 Truncation of Objects Supported.
Definition ots.h:247
@ BT_OTS_OACP_FEAT_CHECKSUM
Bit 2 OACP Calculate Checksum Op Code Supported.
Definition ots.h:232
@ BT_OTS_OACP_FEAT_WRITE
Bit 5 OACP Write Op Code Supported.
Definition ots.h:241
@ BT_OTS_OACP_FEAT_EXECUTE
Bit 3 OACP Execute Op Code Supported.
Definition ots.h:235
@ BT_OTS_OACP_FEAT_PATCH
Bit 8 Patching of Objects Supported
Definition ots.h:250
@ BT_OTS_OACP_FEAT_CREATE
Bit 0 OACP Create Op Code Supported.
Definition ots.h:226
@ BT_OTS_OACP_WRITE_OP_MODE_NONE
Definition ots.h:261
@ BT_OTS_OACP_WRITE_OP_MODE_TRUNCATE
Definition ots.h:262
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
GATT Discover Attributes parameters.
Definition gatt.h:1651
GATT Read parameters.
Definition gatt.h:1742
GATT Subscribe parameters.
Definition gatt.h:2035
GATT Write parameters.
Definition gatt.h:1847
OTS callback structure.
Definition ots.h:601
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:624
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:747
int(* obj_deleted)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id)
Object deleted callback.
Definition ots.h:649
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:729
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:683
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:713
void(* obj_selected)(struct bt_ots *ots, struct bt_conn *conn, uint64_t id)
Object selected callback.
Definition ots.h:660
OTS client callback structure.
Definition ots.h:848
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:910
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:897
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:860
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:924
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:880
OTS client instance.
Definition ots.h:819
struct bt_gatt_write_params write_params
Definition ots.h:838
uint16_t start_handle
Definition ots.h:820
struct bt_ots_client_cb * cb
Definition ots.h:840
uint16_t feature_handle
Definition ots.h:822
uint16_t obj_id_handle
Definition ots.h:829
struct bt_gatt_subscribe_params olcp_sub_params
Definition ots.h:835
uint16_t obj_size_handle
Definition ots.h:825
uint16_t obj_modified_handle
Definition ots.h:828
struct bt_gatt_read_params read_proc
Definition ots.h:839
struct bt_gatt_discover_params oacp_sub_disc_params
Definition ots.h:834
struct bt_ots_feat features
Definition ots.h:842
struct bt_gatt_subscribe_params oacp_sub_params
Definition ots.h:833
uint16_t end_handle
Definition ots.h:821
uint16_t olcp_handle
Definition ots.h:831
uint16_t obj_properties_handle
Definition ots.h:826
struct bt_ots_obj_metadata cur_object
Definition ots.h:844
struct bt_gatt_discover_params olcp_sub_disc_params
Definition ots.h:836
uint16_t oacp_handle
Definition ots.h:830
uint16_t obj_type_handle
Definition ots.h:824
uint16_t obj_name_handle
Definition ots.h:823
uint16_t obj_created_handle
Definition ots.h:827
Date and Time structure.
Definition ots.h:506
uint8_t day
Definition ots.h:509
uint8_t seconds
Definition ots.h:512
uint8_t month
Definition ots.h:508
uint8_t minutes
Definition ots.h:511
uint8_t hours
Definition ots.h:510
uint16_t year
Definition ots.h:507
Features of the OTS.
Definition ots.h:477
uint32_t olcp
Definition ots.h:482
uint32_t oacp
Definition ots.h:479
Descriptor for OTS initialization.
Definition ots.h:752
struct bt_ots_cb * cb
Definition ots.h:757
struct bt_ots_feat features
Definition ots.h:754
Descriptor for OTS object addition.
Definition ots.h:559
uint32_t size
Object size to allocate.
Definition ots.h:561
struct bt_ots_obj_type type
Object type.
Definition ots.h:564
Descriptor for OTS created object.
Definition ots.h:573
uint32_t props
Object properties.
Definition ots.h:597
struct bt_ots_obj_size size
Object size.
Definition ots.h:594
char * name
Object name.
Definition ots.h:583
Metadata of an OTS object.
Definition ots.h:521
uint32_t props
Object Properties.
Definition ots.h:552
struct bt_ots_obj_type type
Object Type.
Definition ots.h:535
struct bt_ots_obj_size size
Object Size.
Definition ots.h:538
Descriptor for OTS Object Size parameter.
Definition ots.h:215
uint32_t cur
Current Size.
Definition ots.h:217
uint32_t alloc
Allocated Size.
Definition ots.h:220
Type of an OTS object.
Definition ots.h:55
struct bt_uuid uuid
Definition ots.h:58
struct bt_uuid_16 uuid_16
Definition ots.h:61
struct bt_uuid_128 uuid_128
Definition ots.h:64
Definition uuid.h:67
Definition uuid.h:53
This is a 'tentative' type and should be used as a pointer only.
Definition uuid.h:49
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:470
Misc utilities.
Bluetooth UUID handling.