nRF5 SDK v17.1.0
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
Object Transfer Service Client

Object Transfer Service Client module. More...

Modules

 Object Transfer Service Client configuration
 
 Object Transfer Service Client
 Object Transfer Service client module.
 
 Object Transfer Service Client Object Action Control Point
 Object Action Control Point module.
 

Data Structures

struct  nrf_ble_ots_c_feature_t
 Structure to hold the features of a server. More...
 
union  nrf_ble_ots_c_obj_properties_t
 Properties of an Object Transfer Service object. More...
 
struct  nrf_ble_ots_c_service_t
 Structure for holding the Object Transfer Service found during the discovery process. More...
 
struct  nrf_ble_ots_c_oacp_response_t
 Structure to hold responses received when writing to the Object Action Control Point on the server. More...
 
struct  nrf_ble_ots_c_obj_size
 Structure to hold the size of the object on the server when read from the Object Size characteristic on the server. More...
 
struct  nrf_ble_ots_c_evt_t
 Structure containing the event from the Object Transfer client module to the application. More...
 
struct  nrf_ble_ots_c_t
 Structure for holding the information related to the Object Transfer Service. More...
 
struct  nrf_ble_ots_c_init_t
 Initialization parameters. These must be supplied when calling nrf_ble_ots_c_init. More...
 

Macros

#define NRF_BLE_OTS_C_DEF(_name)
 Macro for defining a ble_ots instance. More...
 
#define NRF_BLE_OTS_C_ARRAY_DEF(_name, _cnt)
 Macro for defining multiple ble_ots instances. More...
 

Typedefs

typedef void(* nrf_ble_ots_c_evt_handler_t )(nrf_ble_ots_c_evt_t *p_evt)
 Object Transfer handler type.
 

Enumerations

enum  ble_ots_c_oacp_proc_type_t {
  NRF_BLE_OTS_C_OACP_PROC_CREATE = 0x01,
  NRF_BLE_OTS_C_OACP_PROC_DELETE = 0x02,
  NRF_BLE_OTS_C_OACP_PROC_CALC_CHKSUM = 0x03,
  NRF_BLE_OTS_C_OACP_PROC_EXECUTE = 0x04,
  NRF_BLE_OTS_C_OACP_PROC_READ = 0x05,
  NRF_BLE_OTS_C_OACP_PROC_WRITE = 0x06,
  NRF_BLE_OTS_C_OACP_PROC_ABORT = 0x07,
  NRF_BLE_OTS_C_OACP_PROC_RESP = 0x60
}
 Types of Object Action Control Point Procedures. More...
 
enum  ble_ots_c_oacp_res_code_t {
  NRF_BLE_OTS_C_OACP_RES_SUCCESS = 0x01,
  NRF_BLE_OTS_C_OACP_RES_OPCODE_NOT_SUP = 0x02,
  NRF_BLE_OTS_C_OACP_RES_INV_PARAM = 0x03,
  NRF_BLE_OTS_C_OACP_RES_INSUFF_RES = 0x04,
  NRF_BLE_OTS_C_OACP_RES_INV_OBJ = 0x05,
  NRF_BLE_OTS_C_OACP_RES_CHAN_UNAVAIL = 0x06,
  NRF_BLE_OTS_C_OACP_RES_UNSUP_TYPE = 0x07,
  NRF_BLE_OTS_C_OACP_RES_NOT_PERMITTED = 0x08,
  NRF_BLE_OTS_C_OACP_RES_OBJ_LOCKED = 0x09,
  NRF_BLE_OTS_C_OACP_RES_OPER_FAILED = 0x0A
}
 Object Action Control Point return codes. More...
 
enum  nrf_ble_ots_c_evt_type_t {
  NRF_BLE_OTS_C_EVT_DISCOVERY_FAILED,
  NRF_BLE_OTS_C_EVT_DISCOVERY_COMPLETE,
  NRF_BLE_OTS_C_EVT_DISCONN_COMPLETE,
  NRF_BLE_OTS_C_EVT_FEATURE_READ_RESP,
  NRF_BLE_OTS_C_EVT_OACP_RESP,
  NRF_BLE_OTS_C_EVT_OBJ_READ,
  NRF_BLE_OTS_C_EVT_OBJ_WRITE,
  NRF_BLE_OTS_C_EVT_CHANNEL_RELEASED,
  NRF_BLE_OTS_C_EVT_SIZE_READ_RESP,
  NRF_BLE_OTS_C_EVT_PROP_READ_RESP
}
 Type of the Object Transfer Service Client event. More...
 

Functions

ret_code_t nrf_ble_ots_c_init (nrf_ble_ots_c_t *p_ots_c, nrf_ble_ots_c_init_t *p_ots_c_init)
 Function for initializing the Object Transfer client module. More...
 
void nrf_ble_ots_c_on_db_disc_evt (nrf_ble_ots_c_t const *const p_ots_c, ble_db_discovery_evt_t *const p_evt)
 Function for handling events from the Database Discovery module. More...
 
ret_code_t nrf_ble_ots_c_feature_read (nrf_ble_ots_c_t *const p_ots_c)
 Function for reading the features characteristic (BLE_UUID_OTS_FEATURES) on the server. More...
 
ret_code_t nrf_ble_ots_c_obj_size_read (nrf_ble_ots_c_t *const p_ots_c)
 Function for reading the Object Size characteristic (BLE_UUID_OTS_FEATURES) on the server. More...
 
ret_code_t nrf_ble_ots_c_obj_properties_read (nrf_ble_ots_c_t *const p_ots_c)
 Function for reading the Object properties (BLE_UUID_OTS_OBJECT_PROPERTIES) on the server. More...
 
void nrf_ble_ots_c_on_ble_evt (const ble_evt_t *const p_ble_evt, void *p_context)
 Function for handling the Application's BLE Stack events. More...
 
ret_code_t nrf_ble_ots_c_obj_name_read (nrf_ble_ots_c_t *const p_ots_c, ble_data_t *p_obj)
 
ret_code_t nrf_ble_ots_c_obj_name_write (nrf_ble_ots_c_t *const p_ots_c, ble_data_t *p_obj)
 
ret_code_t nrf_ble_ots_c_obj_type_read (nrf_ble_ots_c_t *const p_ots_c)
 
ret_code_t nrf_ble_ots_c_handles_assign (nrf_ble_ots_c_t *const p_ots_c, uint16_t const conn_handle, nrf_ble_ots_c_service_t const *const p_peer_handles)
 Function for assigning handles to an Object Transfer Service Client instance. More...
 

Detailed Description

Object Transfer Service Client module.

This is the main module of the Object Transfer Service (OTS) Client.

Macro Definition Documentation

#define NRF_BLE_OTS_C_ARRAY_DEF (   _name,
  _cnt 
)

Macro for defining multiple ble_ots instances.

Parameters
_nameName of the array of instances.
_cntNumber of instances to define.
#define NRF_BLE_OTS_C_DEF (   _name)

Macro for defining a ble_ots instance.

Parameters
_nameName of the instance.

Enumeration Type Documentation

Types of Object Action Control Point Procedures.

Enumerator
NRF_BLE_OTS_C_OACP_PROC_CREATE 

Create object.

NRF_BLE_OTS_C_OACP_PROC_DELETE 

Delete object.

NRF_BLE_OTS_C_OACP_PROC_CALC_CHKSUM 

Calculate checksum.

NRF_BLE_OTS_C_OACP_PROC_EXECUTE 

Execute object.

NRF_BLE_OTS_C_OACP_PROC_READ 

Read object.

NRF_BLE_OTS_C_OACP_PROC_WRITE 

Write object.

NRF_BLE_OTS_C_OACP_PROC_ABORT 

Abort object.

NRF_BLE_OTS_C_OACP_PROC_RESP 

Procedure response.

Object Action Control Point return codes.

Enumerator
NRF_BLE_OTS_C_OACP_RES_SUCCESS 

Success.

NRF_BLE_OTS_C_OACP_RES_OPCODE_NOT_SUP 

Not supported.

NRF_BLE_OTS_C_OACP_RES_INV_PARAM 

Invalid parameter.

NRF_BLE_OTS_C_OACP_RES_INSUFF_RES 

Insufficient resources.

NRF_BLE_OTS_C_OACP_RES_INV_OBJ 

Invalid object.

NRF_BLE_OTS_C_OACP_RES_CHAN_UNAVAIL 

Channel unavailable.

NRF_BLE_OTS_C_OACP_RES_UNSUP_TYPE 

Unsupported procedure.

NRF_BLE_OTS_C_OACP_RES_NOT_PERMITTED 

Procedure not permitted.

NRF_BLE_OTS_C_OACP_RES_OBJ_LOCKED 

Object locked.

NRF_BLE_OTS_C_OACP_RES_OPER_FAILED 

Operation failed.

Type of the Object Transfer Service Client event.

Enumerator
NRF_BLE_OTS_C_EVT_DISCOVERY_FAILED 

Event indicating that the Object Transfer Service has not been found on the peer.

NRF_BLE_OTS_C_EVT_DISCOVERY_COMPLETE 

Event indicating that the Object Transfer Service is present on the peer device.

NRF_BLE_OTS_C_EVT_DISCONN_COMPLETE 

Event indicating that the Object Transfer Service Client module finished processing the BLE_GAP_EVT_DISCONNECTED event. The application can use this event to do a cleanup related to the Object Transfer Service Client.

NRF_BLE_OTS_C_EVT_FEATURE_READ_RESP 

Event indicating that the feature characteristic was read. The available features of the peer will be provided in the event.

NRF_BLE_OTS_C_EVT_OACP_RESP 

Event indicating that a response was received (result of a write to the OACP).

NRF_BLE_OTS_C_EVT_OBJ_READ 

Event indicating that the Object Transfer Service Client finished reading object from the peer.

NRF_BLE_OTS_C_EVT_OBJ_WRITE 

Event indicating that the Object Transfer Service Client finished writing an object to the peer.

NRF_BLE_OTS_C_EVT_CHANNEL_RELEASED 

Event indicating that the L2CAP Connection Oriented Channel was disconnected.

NRF_BLE_OTS_C_EVT_SIZE_READ_RESP 

Event indicating that the object size characteristic was read.

NRF_BLE_OTS_C_EVT_PROP_READ_RESP 

Event indicating that the object properties characteristic was read.

Function Documentation

ret_code_t nrf_ble_ots_c_feature_read ( nrf_ble_ots_c_t *const  p_ots_c)

Function for reading the features characteristic (BLE_UUID_OTS_FEATURES) on the server.

Parameters
[in,out]p_ots_cPointer to Object Transfer Client structure.
Return values
NRF_SUCCESSOperation success.
err_codeOtherwise, this API propagates the error code returned by function nrf_ble_gq_item_add.
ret_code_t nrf_ble_ots_c_handles_assign ( nrf_ble_ots_c_t *const  p_ots_c,
uint16_t const  conn_handle,
nrf_ble_ots_c_service_t const *const  p_peer_handles 
)

Function for assigning handles to an Object Transfer Service Client instance.

Call this function when a link has been established with a peer to associate the link to an instance of the module. This makes it possible to handle several links and associate each link to a particular instance of the Object Transfer Service Client module. The connection handle and attribute handles are provided from the discovery event NRF_BLE_OTS_C_EVT_DISCOVERY_COMPLETE.

Parameters
[in,out]p_ots_cPointer to the Object Transfer Service Client structure instance for associating the link.
[in]conn_handleConnection handle to be associated with the given Object Transfer Service Client instance.
[in]p_peer_handlesAttribute handles on the Object Transfer Service server that you want this Object Transfer Service client to interact with.
Return values
NRF_SUCCESSIf the connection handle was successfully stored in the Object Transfer Service instance.
NRF_ERROR_NULLIf any of the input parameters are NULL.
err_codeOtherwise, this API propagates the error code returned by function nrf_ble_gq_conn_handle_register.
ret_code_t nrf_ble_ots_c_init ( nrf_ble_ots_c_t p_ots_c,
nrf_ble_ots_c_init_t p_ots_c_init 
)

Function for initializing the Object Transfer client module.

Parameters
[in,out]p_ots_cPointer to the Object Transfer Service client structure instance.
[in]p_ots_c_initInit parameters that contain the event handler that is called by the Object Transfer client module when any related event occurs.
Return values
NRF_SUCCESSIf the service was initialized successfully.
NRF_ERROR_NULLIf any of the input parameters are NULL.
err_codeIf functions from other modules return errors to this function, the SoftDevice Global Error Codes are propagated.
ret_code_t nrf_ble_ots_c_obj_properties_read ( nrf_ble_ots_c_t *const  p_ots_c)

Function for reading the Object properties (BLE_UUID_OTS_OBJECT_PROPERTIES) on the server.

Parameters
[in,out]p_ots_cPointer to Object Transfer Client structure.
Return values
NRF_SUCCESSOperation success.
NRF_ERROR_INVALID_STATEIf the Object Properties characteristic has not been discovered.
err_codeOtherwise, this API propagates the error code returned by function nrf_ble_gq_item_add.
ret_code_t nrf_ble_ots_c_obj_size_read ( nrf_ble_ots_c_t *const  p_ots_c)

Function for reading the Object Size characteristic (BLE_UUID_OTS_FEATURES) on the server.

Parameters
[in,out]p_ots_cPointer to Object Transfer Client structure.
Return values
NRF_SUCCESSOperation success.
NRF_ERROR_INVALID_STATEIf the Object Size characteristic has not been discovered.
err_codeOtherwise, this API propagates the error code returned by function nrf_ble_gq_item_add.
void nrf_ble_ots_c_on_ble_evt ( const ble_evt_t *const  p_ble_evt,
void *  p_context 
)

Function for handling the Application's BLE Stack events.

Parameters
[in]p_ble_evtPointer to the BLE event received.
[in,out]p_contextPointer to the Object Transfer Service client structure instance.
void nrf_ble_ots_c_on_db_disc_evt ( nrf_ble_ots_c_t const *const  p_ots_c,
ble_db_discovery_evt_t *const  p_evt 
)

Function for handling events from the Database Discovery module.

This function handles an event from the Database Discovery module, and determines whether it relates to the discovery of Object Transfer Service at the peer. If it does, the function calls the application's event handler to indicate that Object Transfer Service has been discovered at the peer.

Parameters
[in,out]p_ots_cPointer to the Object Transfer Service client structure instance.
[in]p_evtPointer to the event received from the Database Discovery module.

Documentation feedback | Developer Zone | Subscribe | Updated