Object Server#
The Object Transfer Service(OTS) Static Object Server provides an instance of OTS Object Server implemented using static GATT. This component is instantiable, meaning that several named instances can be created. For each instance, a configuration header, an instance header and a source file is generated to encapsulate functionalities and initialize and manage the instance. These instance variables are available in a generated header file, sl_bt_ots_server_instances.h. The instances are initialized automatically after the boot event of the Bluetooth stack. Selecting this component will include the Object Transfer Service (OTS) Object Server Core component, which is the implementation of the OTS Object Server API.
Modules#
sl_bt_ots_server_capabilities_t
sl_bt_ots_server_client_db_entry_t
Typedefs#
OTS Object Server handle.
OTS Object Server instance type.
Functions#
Macros#
Typedef Documentation#
sl_bt_ots_server_handle_t#
typedef struct sl_bt_ots_server* sl_bt_ots_server_handle_t
OTS Object Server handle.
69
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_connection_callback_t#
typedef void(* sl_bt_ots_server_connection_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client) )(sl_bt_ots_server_handle_t server, uint16_t client)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
OTS Object Server callback function prototype for client connection or disconnection
77
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_subscription_callback_t#
typedef void(* sl_bt_ots_subscription_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_subscription_status_t status) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_subscription_status_t status)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | status | Subscription status. |
OTS callback function prototype for indication subscription status
86
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_olcp_callback_t#
typedef sl_bt_ots_olcp_response_code_t(* sl_bt_ots_server_olcp_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_olcp_event_t event, sl_bt_ots_olcp_parameters_t *parameters, uint32_t *number_of_objects) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_olcp_event_t event, sl_bt_ots_olcp_parameters_t *parameters, uint32_t *number_of_objects)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Object ID. |
[in] | event | OLCP event. |
[in] | parameters | OLCP event parameters. |
[out] | number_of_objects | Number of objects in case of that opcode/event. |
OTS Object Server callback function prototype to handle OLCP events Returns
OLCP response code
100
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_oacp_callback_t#
typedef sl_bt_ots_oacp_response_code_t(* sl_bt_ots_server_oacp_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_oacp_event_t event, sl_bt_ots_oacp_parameters_t *parameters, sl_bt_ots_oacp_response_data_t *response_data, uint16_t *max_sdu, uint16_t *max_pdu) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_oacp_event_t event, sl_bt_ots_oacp_parameters_t *parameters, sl_bt_ots_oacp_response_data_t *response_data, uint16_t *max_sdu, uint16_t *max_pdu)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Object ID. |
[in] | event | OACP event. |
[in] | parameters | OACP event parameters. |
[out] | response_data | The response data |
[inout] | max_sdu | The Maximum Service Data Unit size the local channel endpoint can accept Range: 23 to 65533. Caller passes a suggested value of SDU as an input. |
[inout] | max_pdu | The maximum PDU payload size the local channel endpoint can accept Range:23 to 252. PDU and SDU are optimal when SDU = n * PDU + 2. Caller passes a suggested value of PDU as an input. |
OTS Object Server callback function prototype to handle OACP events Returns
OACP response code
134
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_data_callback_t#
typedef sl_bt_ots_l2cap_credit_t(* sl_bt_ots_server_data_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, int32_t current_offset, void *data, int32_t size) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, int32_t current_offset, void *data, int32_t size)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Object ID. |
[in] | current_offset | Current offset from the beginning of the object. |
[in] | data | Pointer to the received data. |
[in] | size | Size of the received data. |
OTS Object Server callback function prototype to handle data reception Returns
Credits to give to the transmitter.
153
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_data_transfer_finished_t#
typedef void(* sl_bt_ots_server_data_transfer_finished_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_transfer_result_t result) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_transfer_result_t result)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Object ID. |
[in] | result | Size of the data. |
OTS Object Server callback function prototype to handle transmission status
167
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_data_transmit_callback_t#
typedef void(* sl_bt_ots_server_data_transmit_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, uint32_t current_offset, uint32_t size, uint8_t **data, uint32_t *data_size) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, uint32_t current_offset, uint32_t size, uint8_t **data, uint32_t *data_size)
[in] | server | Client handle. |
[in] | object | Object ID reference. |
[in] | offset | Current offset of requested data |
[in] | size | Maximum size of requested data |
[out] | data | Pointer of pointer to data |
[out] | data_size | Size of the provided data |
OTS Object Server callback function prototype to handle data transmission
181
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_object_metadata_write_callback_t#
typedef sl_bt_ots_object_metadata_write_response_code_t(* sl_bt_ots_server_object_metadata_write_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_object_metadata_write_event_type_t event, sl_bt_ots_object_metadata_write_parameters_t *parameters) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_object_metadata_write_event_type_t event, sl_bt_ots_object_metadata_write_parameters_t *parameters)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Object ID. |
[in] | event | Metadata write event. |
[in] | parameters | Metadata event parameters. |
OTS Object Server callback function prototype to handle metadata writes Returns
Response code
198
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_object_metadata_read_callback_t#
typedef sl_bt_ots_object_metadata_read_response_code_t(* sl_bt_ots_server_object_metadata_read_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_object_metadata_read_event_type_t event, sl_bt_ots_object_metadata_read_parameters_t *parameters) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t *object, sl_bt_ots_object_metadata_read_event_type_t event, sl_bt_ots_object_metadata_read_parameters_t *parameters)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Object ID. |
[in] | event | Metadata read event. |
[out] | parameters | Metadata event parameters to be filled. |
OTS Object Server callback function prototype to handle metadata writes Returns
Response code
213
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_object_list_filter_wtite_callback_t#
typedef sl_bt_ots_object_metadata_write_response_code_t(* sl_bt_ots_server_object_list_filter_wtite_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_list_filter_content_t *filter) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_list_filter_content_t *filter)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | filter | Pointer to the filter |
OTS Object Server callback function prototype to set Object List Filter Returns
Response code
226
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_object_list_filter_read_callback_t#
typedef sl_bt_ots_object_metadata_read_response_code_t(* sl_bt_ots_server_object_list_filter_read_callback_t) (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_list_filter_content_t *filter) )(sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_list_filter_content_t *filter)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[out] | filter | Pointer to the filter to be filled. |
OTS Object Server callback function prototype to get Object List Filter Returns
Response code
237
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_t#
typedef struct sl_bt_ots_server sl_bt_ots_server_t
OTS Object Server instance type.
283
of file common/ots/inc/sl_bt_ots_server.h
Function Documentation#
sl_bt_ots_server_init#
sl_status_t sl_bt_ots_server_init (sl_bt_ots_server_handle_t server, sl_bt_ots_gattdb_handles_t * handles, sl_bt_ots_server_callbacks_t * callbacks)
[in] | server | Server handle. |
[in] | handles | GATT database handles. |
[in] | callbacks | Callbacks to handle requests. |
Initialize the OTS Object Server. Returns
Response code
295
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_set_current_object#
sl_status_t sl_bt_ots_server_set_current_object (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t * object, sl_bt_ots_object_properties_t * properties, sl_bt_ots_object_size_t * size)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | object | Pointer to the Object ID. If NULL, Current Object will set to Invalid Object. |
[in] | properties | Pointer to the Object Properties. If NULL, all OACP actions will be passed using the callbacks. If not NULL, the server will respond with OACP response codes automatically and pass only the OACP operations those are permitted by the given object properties. |
[in] | size | Pointer to the Object Size. If NULL, all OACP actions will be passed using the callbacks. If not NULL, the server will respond with OACP response codes automatically and pass only the OACP operations those are permitted by the given object size and server capability configuration. |
Set the current object on the server for the specified client Returns
Response code
318
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_get_current_object#
sl_status_t sl_bt_ots_server_get_current_object (sl_bt_ots_server_handle_t server, uint16_t client, sl_bt_ots_object_id_t * object)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[out] | object | Pointer to the Object ID. |
Get the current object on the server for the specified client Returns
Response code
331
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_abort#
sl_status_t sl_bt_ots_server_abort (sl_bt_ots_server_handle_t server, uint16_t client)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
Abort transmission on the Object Server instance for a specified client. Returns
Response code
341
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_object_changed#
sl_status_t sl_bt_ots_server_object_changed (sl_bt_ots_server_handle_t server, sl_bt_ots_object_id_t * object, sl_bt_ots_object_changed_flags_t flags)
[in] | server | Server handle. |
[in] | object | Pointer to the Object ID. |
[in] | flags | The following masks can be used to indicate the nature of change:
|
Indicate that an object has been changed on the server. Returns
Response code
356
of file common/ots/inc/sl_bt_ots_server.h
sl_bt_ots_server_increase_credit#
sl_status_t sl_bt_ots_server_increase_credit (sl_bt_ots_server_handle_t server, uint16_t client, uint16_t credit)
[in] | server | Server handle. |
[in] | client | Connection handle for the client. |
[in] | credit | Number of credit to give (in packets). |
Increase the credit for the L2CAP transfer that is in progress Returns
Response code
367
of file common/ots/inc/sl_bt_ots_server.h