User Messaging#

User Messaging.

Modules

sl_bt_evt_user_message_to_host

Used by the target application on a device to initiate communication and send a message to the NCP host.

Functions

sl_status_t

sl_bt_user_message_to_target (size_t data_len, const uint8_t *data, size_t max_response_size, size_t *response_len, uint8_t *response)

Detailed Description#

User Messaging.

This class provides one command and one event which can be used by a NCP host and target to implement a communication mechanism with a custom proprietary protocol. An application must decide whether and how the command and event are used. The stack does not produce or consume any messages belonging to this class.

Function Documentation#

sl_bt_user_message_to_target()#

sl_status_t sl_bt_user_message_to_target

(

size_t

data_len,

const uint8_t *

data,

size_t

max_response_size,

size_t *

response_len,

uint8_t *

response

)

Used by an NCP host to send a message to the target application on device. The application on target is must send the response with sl_bt_send_rsp_user_message_to_target.

Parameters

[in]

data_len

Array length

[in]

data

The message

[in]

max_response_size

Size of output buffer passed in response

[out]

response_len

On return, set to the length of output data written to response

[out]

response

The response message

Returns

      SL_STATUS_OK if successful. Error code otherwise.