Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Object Transfer Service (OTS)

Object Transfer Service (OTS) More...

Data Structures

struct  bt_ots_obj_type
 Type of an OTS object. More...
 
struct  bt_ots_obj_size
 Descriptor for OTS Object Size parameter. More...
 
struct  bt_ots_obj_metadata
 Descriptor for OTS object initialization. More...
 
struct  bt_ots_feat
 Features of the OTS. More...
 
struct  bt_ots_cb
 OTS callback structure. More...
 
struct  bt_ots_init
 Descriptor for OTS initialization. More...
 

Macros

#define BT_OTS_OBJ_ID_SIZE   6
 Size of OTS object ID (in bytes). More...
 
#define BT_OTS_OBJ_ID_MIN   0x000000000100
 Minimum allowed value for object ID (except ID for directory listing) More...
 
#define BT_OTS_OBJ_ID_MAX   0xFFFFFFFFFFFF
 Maximum allowed value for object ID (except ID for directory listing) More...
 
#define OTS_OBJ_ID_DIR_LIST   0x000000000000
 ID of the Directory Listing Object. More...
 
#define BT_OTS_OBJ_ID_MASK   BIT64_MASK(48)
 Mask for OTS object IDs, preserving the 48 bits. More...
 
#define BT_OTS_OBJ_ID_STR_LEN   15
 Length of OTS object ID string (in bytes). More...
 
#define BT_OTS_OBJ_SET_PROP_DELETE(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_DELETE, 1)
 Set BT_OTS_OBJ_PROP_DELETE property. More...
 
#define BT_OTS_OBJ_SET_PROP_EXECUTE(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_EXECUTE, 1)
 Set BT_OTS_OBJ_PROP_EXECUTE property. More...
 
#define BT_OTS_OBJ_SET_PROP_READ(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_READ, 1)
 Set BT_OTS_OBJ_PROP_READ property. More...
 
#define BT_OTS_OBJ_SET_PROP_WRITE(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_WRITE, 1)
 Set BT_OTS_OBJ_PROP_WRITE property. More...
 
#define BT_OTS_OBJ_SET_PROP_APPEND(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_APPEND, 1)
 Set BT_OTS_OBJ_PROP_APPEND property. More...
 
#define BT_OTS_OBJ_SET_PROP_TRUNCATE(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_TRUNCATE, 1)
 Set BT_OTS_OBJ_PROP_TRUNCATE property. More...
 
#define BT_OTS_OBJ_SET_PROP_PATCH(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_PATCH, 1)
 Set BT_OTS_OBJ_PROP_PATCH property. More...
 
#define BT_OTS_OBJ_SET_PROP_MARKED(prop)    WRITE_BIT(prop, BT_OTS_OBJ_PROP_MARKED, 1)
 Set BT_OTS_OBJ_SET_PROP_MARKED property. More...
 
#define BT_OTS_OBJ_GET_PROP_DELETE(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_DELETE))
 Get BT_OTS_OBJ_PROP_DELETE property. More...
 
#define BT_OTS_OBJ_GET_PROP_EXECUTE(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_EXECUTE))
 Get BT_OTS_OBJ_PROP_EXECUTE property. More...
 
#define BT_OTS_OBJ_GET_PROP_READ(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_READ))
 Get BT_OTS_OBJ_PROP_READ property. More...
 
#define BT_OTS_OBJ_GET_PROP_WRITE(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_WRITE))
 Get BT_OTS_OBJ_PROP_WRITE property. More...
 
#define BT_OTS_OBJ_GET_PROP_APPEND(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_APPEND))
 Get BT_OTS_OBJ_PROP_APPEND property. More...
 
#define BT_OTS_OBJ_GET_PROP_TRUNCATE(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_TRUNCATE))
 Get BT_OTS_OBJ_PROP_TRUNCATE property. More...
 
#define BT_OTS_OBJ_GET_PROP_PATCH(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_PATCH))
 Get BT_OTS_OBJ_PROP_PATCH property. More...
 
#define BT_OTS_OBJ_GET_PROP_MARKED(prop)    ((prop) & BIT(BT_OTS_OBJ_PROP_MARKED))
 Get BT_OTS_OBJ_PROP_MARKED property. More...
 
#define BT_OTS_OACP_SET_FEAT_CREATE(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_CREATE, 1)
 Set BT_OTS_OACP_SET_FEAT_CREATE feature. More...
 
#define BT_OTS_OACP_SET_FEAT_DELETE(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_DELETE, 1)
 Set BT_OTS_OACP_FEAT_DELETE feature. More...
 
#define BT_OTS_OACP_SET_FEAT_CHECKSUM(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_CHECKSUM, 1)
 Set BT_OTS_OACP_FEAT_CHECKSUM feature. More...
 
#define BT_OTS_OACP_SET_FEAT_EXECUTE(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_EXECUTE, 1)
 Set BT_OTS_OACP_FEAT_EXECUTE feature. More...
 
#define BT_OTS_OACP_SET_FEAT_READ(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_READ, 1)
 Set BT_OTS_OACP_FEAT_READ feature. More...
 
#define BT_OTS_OACP_SET_FEAT_WRITE(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_WRITE, 1)
 Set BT_OTS_OACP_FEAT_WRITE feature. More...
 
#define BT_OTS_OACP_SET_FEAT_APPEND(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_APPEND, 1)
 Set BT_OTS_OACP_FEAT_APPEND feature. More...
 
#define BT_OTS_OACP_SET_FEAT_TRUNCATE(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_TRUNCATE, 1)
 Set BT_OTS_OACP_FEAT_TRUNCATE feature. More...
 
#define BT_OTS_OACP_SET_FEAT_PATCH(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_PATCH, 1)
 Set BT_OTS_OACP_FEAT_PATCH feature. More...
 
#define BT_OTS_OACP_SET_FEAT_ABORT(feat)    WRITE_BIT(feat, BT_OTS_OACP_FEAT_ABORT, 1)
 Set BT_OTS_OACP_FEAT_ABORT feature. More...
 
#define BT_OTS_OACP_GET_FEAT_CREATE(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_CREATE))
 Get BT_OTS_OACP_FEAT_CREATE feature. More...
 
#define BT_OTS_OACP_GET_FEAT_DELETE(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_DELETE))
 Get BT_OTS_OACP_FEAT_DELETE feature. More...
 
#define BT_OTS_OACP_GET_FEAT_CHECKSUM(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_CHECKSUM))
 Get BT_OTS_OACP_FEAT_CHECKSUM feature. More...
 
#define BT_OTS_OACP_GET_FEAT_EXECUTE(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_EXECUTE))
 Get BT_OTS_OACP_FEAT_EXECUTE feature. More...
 
#define BT_OTS_OACP_GET_FEAT_READ(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_READ))
 Get BT_OTS_OACP_FEAT_READ feature. More...
 
#define BT_OTS_OACP_GET_FEAT_WRITE(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_WRITE))
 Get BT_OTS_OACP_FEAT_WRITE feature. More...
 
#define BT_OTS_OACP_GET_FEAT_APPEND(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_APPEND))
 Get BT_OTS_OACP_FEAT_APPEND feature. More...
 
#define BT_OTS_OACP_GET_FEAT_TRUNCATE(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_TRUNCATE))
 Get BT_OTS_OACP_FEAT_TRUNCATE feature. More...
 
#define BT_OTS_OACP_GET_FEAT_PATCH(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_PATCH))
 Get BT_OTS_OACP_FEAT_PATCH feature. More...
 
#define BT_OTS_OACP_GET_FEAT_ABORT(feat)    ((feat) & BIT(BT_OTS_OACP_FEAT_ABORT))
 Get BT_OTS_OACP_FEAT_ABORT feature. More...
 
#define BT_OTS_OLCP_SET_FEAT_GO_TO(feat)    WRITE_BIT(feat, BT_OTS_OLCP_FEAT_GO_TO, 1)
 Set BT_OTS_OLCP_FEAT_GO_TO feature. More...
 
#define BT_OTS_OLCP_SET_FEAT_ORDER(feat)    WRITE_BIT(feat, BT_OTS_OLCP_FEAT_ORDER, 1)
 Set BT_OTS_OLCP_FEAT_ORDER feature. More...
 
#define BT_OTS_OLCP_SET_FEAT_NUM_REQ(feat)    WRITE_BIT(feat, BT_OTS_OLCP_FEAT_NUM_REQ, 1)
 Set BT_OTS_OLCP_FEAT_NUM_REQ feature. More...
 
#define BT_OTS_OLCP_SET_FEAT_CLEAR(feat)    WRITE_BIT(feat, BT_OTS_OLCP_FEAT_CLEAR, 1)
 Set BT_OTS_OLCP_FEAT_CLEAR feature. More...
 
#define BT_OTS_OLCP_GET_FEAT_GO_TO(feat)    ((feat) & BIT(BT_OTS_OLCP_FEAT_GO_TO))
 Get BT_OTS_OLCP_GET_FEAT_GO_TO feature. More...
 
#define BT_OTS_OLCP_GET_FEAT_ORDER(feat)    ((feat) & BIT(BT_OTS_OLCP_FEAT_ORDER))
 Get BT_OTS_OLCP_GET_FEAT_ORDER feature. More...
 
#define BT_OTS_OLCP_GET_FEAT_NUM_REQ(feat)    ((feat) & BIT(BT_OTS_OLCP_FEAT_NUM_REQ))
 Get BT_OTS_OLCP_GET_FEAT_NUM_REQ feature. More...
 
#define BT_OTS_OLCP_GET_FEAT_CLEAR(feat)    ((feat) & BIT(BT_OTS_OLCP_FEAT_CLEAR))
 Get BT_OTS_OLCP_GET_FEAT_CLEAR feature. More...
 

Enumerations

enum  {
  BT_OTS_OBJ_PROP_DELETE = 0 , BT_OTS_OBJ_PROP_EXECUTE = 1 , BT_OTS_OBJ_PROP_READ = 2 , BT_OTS_OBJ_PROP_WRITE = 3 ,
  BT_OTS_OBJ_PROP_APPEND = 4 , BT_OTS_OBJ_PROP_TRUNCATE = 5 , BT_OTS_OBJ_PROP_PATCH = 6 , BT_OTS_OBJ_PROP_MARKED = 7
}
 Properties of an OTS object. More...
 
enum  {
  BT_OTS_OACP_FEAT_CREATE = 0 , BT_OTS_OACP_FEAT_DELETE = 1 , BT_OTS_OACP_FEAT_CHECKSUM = 2 , BT_OTS_OACP_FEAT_EXECUTE = 3 ,
  BT_OTS_OACP_FEAT_READ = 4 , BT_OTS_OACP_FEAT_WRITE = 5 , BT_OTS_OACP_FEAT_APPEND = 6 , BT_OTS_OACP_FEAT_TRUNCATE = 7 ,
  BT_OTS_OACP_FEAT_PATCH = 8 , BT_OTS_OACP_FEAT_ABORT = 9
}
 Object Action Control Point Feature bits. More...
 
enum  { BT_OTS_OLCP_FEAT_GO_TO = 0 , BT_OTS_OLCP_FEAT_ORDER = 1 , BT_OTS_OLCP_FEAT_NUM_REQ = 2 , BT_OTS_OLCP_FEAT_CLEAR = 3 }
 Object List Control Point Feature bits. More...
 

Functions

int bt_ots_obj_add (struct bt_ots *ots, struct bt_ots_obj_metadata *obj_init)
 Add an object to the OTS instance. More...
 
int bt_ots_obj_delete (struct bt_ots *ots, uint64_t id)
 Delete an object from the OTS instance. More...
 
voidbt_ots_svc_decl_get (struct bt_ots *ots)
 Get the service declaration attribute. More...
 
int bt_ots_init (struct bt_ots *ots, struct bt_ots_init *ots_init)
 Initialize the OTS instance. More...
 
struct bt_ots * bt_ots_free_instance_get (void)
 Get a free instance of OTS from the pool. More...
 
static int bt_ots_obj_id_to_str (uint64_t obj_id, char *str, size_t len)
 Converts binary OTS Object ID to string. More...
 

Detailed Description

Object Transfer Service (OTS)

[Experimental] Users should note that the APIs can change as a part of ongoing development.

Macro Definition Documentation

◆ BT_OTS_OACP_GET_FEAT_ABORT

#define BT_OTS_OACP_GET_FEAT_ABORT (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_ABORT))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_ABORT feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_APPEND

#define BT_OTS_OACP_GET_FEAT_APPEND (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_APPEND))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_APPEND feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_CHECKSUM

#define BT_OTS_OACP_GET_FEAT_CHECKSUM (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_CHECKSUM))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_CHECKSUM feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_CREATE

#define BT_OTS_OACP_GET_FEAT_CREATE (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_CREATE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_CREATE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_DELETE

#define BT_OTS_OACP_GET_FEAT_DELETE (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_DELETE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_DELETE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_EXECUTE

#define BT_OTS_OACP_GET_FEAT_EXECUTE (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_EXECUTE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_EXECUTE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_PATCH

#define BT_OTS_OACP_GET_FEAT_PATCH (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_PATCH))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_PATCH feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_READ

#define BT_OTS_OACP_GET_FEAT_READ (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_READ))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_READ feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_TRUNCATE

#define BT_OTS_OACP_GET_FEAT_TRUNCATE (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_TRUNCATE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_TRUNCATE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_GET_FEAT_WRITE

#define BT_OTS_OACP_GET_FEAT_WRITE (   feat)     ((feat) & BIT(BT_OTS_OACP_FEAT_WRITE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OACP_FEAT_WRITE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_ABORT

#define BT_OTS_OACP_SET_FEAT_ABORT (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_ABORT, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_ABORT feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_APPEND

#define BT_OTS_OACP_SET_FEAT_APPEND (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_APPEND, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_APPEND feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_CHECKSUM

#define BT_OTS_OACP_SET_FEAT_CHECKSUM (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_CHECKSUM, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_CHECKSUM feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_CREATE

#define BT_OTS_OACP_SET_FEAT_CREATE (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_CREATE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_SET_FEAT_CREATE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_DELETE

#define BT_OTS_OACP_SET_FEAT_DELETE (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_DELETE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_DELETE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_EXECUTE

#define BT_OTS_OACP_SET_FEAT_EXECUTE (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_EXECUTE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_EXECUTE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_PATCH

#define BT_OTS_OACP_SET_FEAT_PATCH (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_PATCH, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_PATCH feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_READ

#define BT_OTS_OACP_SET_FEAT_READ (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_READ, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_READ feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_TRUNCATE

#define BT_OTS_OACP_SET_FEAT_TRUNCATE (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_TRUNCATE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_TRUNCATE feature.

Parameters
featOTS features.

◆ BT_OTS_OACP_SET_FEAT_WRITE

#define BT_OTS_OACP_SET_FEAT_WRITE (   feat)     WRITE_BIT(feat, BT_OTS_OACP_FEAT_WRITE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OACP_FEAT_WRITE feature.

Parameters
featOTS features.

◆ BT_OTS_OBJ_GET_PROP_APPEND

#define BT_OTS_OBJ_GET_PROP_APPEND (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_APPEND))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_APPEND property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_DELETE

#define BT_OTS_OBJ_GET_PROP_DELETE (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_DELETE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_DELETE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_EXECUTE

#define BT_OTS_OBJ_GET_PROP_EXECUTE (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_EXECUTE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_EXECUTE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_MARKED

#define BT_OTS_OBJ_GET_PROP_MARKED (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_MARKED))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_MARKED property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_PATCH

#define BT_OTS_OBJ_GET_PROP_PATCH (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_PATCH))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_PATCH property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_READ

#define BT_OTS_OBJ_GET_PROP_READ (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_READ))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_READ property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_TRUNCATE

#define BT_OTS_OBJ_GET_PROP_TRUNCATE (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_TRUNCATE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_TRUNCATE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_GET_PROP_WRITE

#define BT_OTS_OBJ_GET_PROP_WRITE (   prop)     ((prop) & BIT(BT_OTS_OBJ_PROP_WRITE))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OBJ_PROP_WRITE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_ID_MASK

#define BT_OTS_OBJ_ID_MASK   BIT64_MASK(48)

#include <include/bluetooth/services/ots.h>

Mask for OTS object IDs, preserving the 48 bits.

◆ BT_OTS_OBJ_ID_MAX

#define BT_OTS_OBJ_ID_MAX   0xFFFFFFFFFFFF

#include <include/bluetooth/services/ots.h>

Maximum allowed value for object ID (except ID for directory listing)

◆ BT_OTS_OBJ_ID_MIN

#define BT_OTS_OBJ_ID_MIN   0x000000000100

#include <include/bluetooth/services/ots.h>

Minimum allowed value for object ID (except ID for directory listing)

◆ BT_OTS_OBJ_ID_SIZE

#define BT_OTS_OBJ_ID_SIZE   6

#include <include/bluetooth/services/ots.h>

Size of OTS object ID (in bytes).

◆ BT_OTS_OBJ_ID_STR_LEN

#define BT_OTS_OBJ_ID_STR_LEN   15

#include <include/bluetooth/services/ots.h>

Length of OTS object ID string (in bytes).

◆ BT_OTS_OBJ_SET_PROP_APPEND

#define BT_OTS_OBJ_SET_PROP_APPEND (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_APPEND, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_APPEND property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_DELETE

#define BT_OTS_OBJ_SET_PROP_DELETE (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_DELETE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_DELETE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_EXECUTE

#define BT_OTS_OBJ_SET_PROP_EXECUTE (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_EXECUTE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_EXECUTE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_MARKED

#define BT_OTS_OBJ_SET_PROP_MARKED (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_MARKED, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_SET_PROP_MARKED property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_PATCH

#define BT_OTS_OBJ_SET_PROP_PATCH (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_PATCH, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_PATCH property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_READ

#define BT_OTS_OBJ_SET_PROP_READ (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_READ, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_READ property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_TRUNCATE

#define BT_OTS_OBJ_SET_PROP_TRUNCATE (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_TRUNCATE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_TRUNCATE property.

Parameters
propObject properties.

◆ BT_OTS_OBJ_SET_PROP_WRITE

#define BT_OTS_OBJ_SET_PROP_WRITE (   prop)     WRITE_BIT(prop, BT_OTS_OBJ_PROP_WRITE, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OBJ_PROP_WRITE property.

Parameters
propObject properties.

◆ BT_OTS_OLCP_GET_FEAT_CLEAR

#define BT_OTS_OLCP_GET_FEAT_CLEAR (   feat)     ((feat) & BIT(BT_OTS_OLCP_FEAT_CLEAR))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OLCP_GET_FEAT_CLEAR feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_GET_FEAT_GO_TO

#define BT_OTS_OLCP_GET_FEAT_GO_TO (   feat)     ((feat) & BIT(BT_OTS_OLCP_FEAT_GO_TO))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OLCP_GET_FEAT_GO_TO feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_GET_FEAT_NUM_REQ

#define BT_OTS_OLCP_GET_FEAT_NUM_REQ (   feat)     ((feat) & BIT(BT_OTS_OLCP_FEAT_NUM_REQ))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OLCP_GET_FEAT_NUM_REQ feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_GET_FEAT_ORDER

#define BT_OTS_OLCP_GET_FEAT_ORDER (   feat)     ((feat) & BIT(BT_OTS_OLCP_FEAT_ORDER))

#include <include/bluetooth/services/ots.h>

Get BT_OTS_OLCP_GET_FEAT_ORDER feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_SET_FEAT_CLEAR

#define BT_OTS_OLCP_SET_FEAT_CLEAR (   feat)     WRITE_BIT(feat, BT_OTS_OLCP_FEAT_CLEAR, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OLCP_FEAT_CLEAR feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_SET_FEAT_GO_TO

#define BT_OTS_OLCP_SET_FEAT_GO_TO (   feat)     WRITE_BIT(feat, BT_OTS_OLCP_FEAT_GO_TO, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OLCP_FEAT_GO_TO feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_SET_FEAT_NUM_REQ

#define BT_OTS_OLCP_SET_FEAT_NUM_REQ (   feat)     WRITE_BIT(feat, BT_OTS_OLCP_FEAT_NUM_REQ, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OLCP_FEAT_NUM_REQ feature.

Parameters
featOTS features.

◆ BT_OTS_OLCP_SET_FEAT_ORDER

#define BT_OTS_OLCP_SET_FEAT_ORDER (   feat)     WRITE_BIT(feat, BT_OTS_OLCP_FEAT_ORDER, 1)

#include <include/bluetooth/services/ots.h>

Set BT_OTS_OLCP_FEAT_ORDER feature.

Parameters
featOTS features.

◆ OTS_OBJ_ID_DIR_LIST

#define OTS_OBJ_ID_DIR_LIST   0x000000000000

#include <include/bluetooth/services/ots.h>

ID of the Directory Listing Object.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <include/bluetooth/services/ots.h>

Properties of an OTS object.

Enumerator
BT_OTS_OBJ_PROP_DELETE 

Bit 0 Deletion of this object is permitted

BT_OTS_OBJ_PROP_EXECUTE 

Bit 1 Execution of this object is permitted

BT_OTS_OBJ_PROP_READ 

Bit 2 Reading this object is permitted

BT_OTS_OBJ_PROP_WRITE 

Bit 3 Writing data to this object is permitted

BT_OTS_OBJ_PROP_APPEND 

Bit 4 Appending data to this object is permitted.

   Appending data increases its Allocated Size.
BT_OTS_OBJ_PROP_TRUNCATE 

Bit 5 Truncation of this object is permitted

BT_OTS_OBJ_PROP_PATCH 

Bit 6 Patching this object is permitted.

    Patching this object overwrites some of
    the object's existing contents.
BT_OTS_OBJ_PROP_MARKED 

Bit 7 This object is a marked object

◆ anonymous enum

anonymous enum

#include <include/bluetooth/services/ots.h>

Object Action Control Point Feature bits.

Enumerator
BT_OTS_OACP_FEAT_CREATE 

Bit 0 OACP Create Op Code Supported

BT_OTS_OACP_FEAT_DELETE 

Bit 1 OACP Delete Op Code Supported

BT_OTS_OACP_FEAT_CHECKSUM 

Bit 2 OACP Calculate Checksum Op Code Supported

BT_OTS_OACP_FEAT_EXECUTE 

Bit 3 OACP Execute Op Code Supported

BT_OTS_OACP_FEAT_READ 

Bit 4 OACP Read Op Code Supported

BT_OTS_OACP_FEAT_WRITE 

Bit 5 OACP Write Op Code Supported

BT_OTS_OACP_FEAT_APPEND 

Bit 6 Appending Additional Data to Objects Supported

BT_OTS_OACP_FEAT_TRUNCATE 

Bit 7 Truncation of Objects Supported

BT_OTS_OACP_FEAT_PATCH 

Bit 8 Patching of Objects Supported

BT_OTS_OACP_FEAT_ABORT 

Bit 9 OACP Abort Op Code Supported

◆ anonymous enum

anonymous enum

#include <include/bluetooth/services/ots.h>

Object List Control Point Feature bits.

Enumerator
BT_OTS_OLCP_FEAT_GO_TO 

Bit 0 OLCP Go To Op Code Supported

BT_OTS_OLCP_FEAT_ORDER 

Bit 1 OLCP Order Op Code Supported

BT_OTS_OLCP_FEAT_NUM_REQ 

Bit 2 OLCP Request Number of Objects Op Code Supported

BT_OTS_OLCP_FEAT_CLEAR 

Bit 3 OLCP Clear Marking Op Code Supported

Function Documentation

◆ bt_ots_free_instance_get()

struct bt_ots * bt_ots_free_instance_get ( void  )

#include <include/bluetooth/services/ots.h>

Get a free instance of OTS from the pool.

Returns
OTS instance in case of success or NULL in case of error.

◆ bt_ots_init()

int bt_ots_init ( struct bt_ots *  ots,
struct bt_ots_init ots_init 
)

#include <include/bluetooth/services/ots.h>

Initialize the OTS instance.

Parameters
otsOTS instance.
ots_initOTS initialization descriptor.
Returns
0 in case of success or negative value in case of error.

◆ bt_ots_obj_add()

int bt_ots_obj_add ( struct bt_ots *  ots,
struct bt_ots_obj_metadata obj_init 
)

#include <include/bluetooth/services/ots.h>

Add an object to the OTS instance.

This function adds an object to the OTS database. When the object is being added, a callback obj_created() is called to notify the user about a new object ID.

Parameters
otsOTS instance.
obj_initMeta data of the object.
Returns
0 in case of success or negative value in case of error.

◆ bt_ots_obj_delete()

int bt_ots_obj_delete ( struct bt_ots *  ots,
uint64_t  id 
)

#include <include/bluetooth/services/ots.h>

Delete an object from the OTS instance.

This function deletes an object from the OTS database. When the object is deleted a callback obj_deleted() is called to notify the user about this event. At this point, it is possible to free allocated buffer for object data.

Parameters
otsOTS instance.
idID of the object to be deleted (uint48).
Returns
0 in case of success or negative value in case of error.

◆ bt_ots_obj_id_to_str()

static int bt_ots_obj_id_to_str ( uint64_t  obj_id,
char *  str,
size_t  len 
)
inlinestatic

#include <include/bluetooth/services/ots.h>

Converts binary OTS Object ID to string.

Parameters
obj_idObject ID.
strAddress of user buffer with enough room to store formatted string containing binary Object ID.
lenLength of data to be copied to user string buffer. Refer to BT_OTS_OBJ_ID_STR_LEN about recommended value.
Returns
Number of successfully formatted bytes from binary ID.

◆ bt_ots_svc_decl_get()

void * bt_ots_svc_decl_get ( struct bt_ots *  ots)

#include <include/bluetooth/services/ots.h>

Get the service declaration attribute.

This function is enabled for CONFIG_BT_OTS_SECONDARY_SVC configuration. The first service attribute can be included in any other GATT service.

Parameters
otsOTS instance.
Returns
The first OTS attribute instance.