User Messaging

User Messaging.


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


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)
sl_status_t sl_bt_user_manage_event_filter (size_t data_len, const uint8_t *data)
void sl_bt_user_reset_to_dfu ()

Detailed Description

User Messaging.

This class provides commands and events, 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 the target must send the response with sl_bt_send_rsp_user_message_to_target.

[in]data_lenLength of data in data
[in]dataThe message
[in]max_response_sizeSize of output buffer passed in response
[out]response_lenOn return, set to the length of output data written to response
[out]responseThe response message
SL_STATUS_OK if successful. Error code otherwise.

◆ sl_bt_user_manage_event_filter()

sl_status_t sl_bt_user_manage_event_filter ( size_t  data_len,
const uint8_t *  data 

Manage NCP event filter. When the event filter is in use, API events passing the filter will be sent to the host and those that do not pass are discarded by the target. For functionality details, see the NCP component in the Bluetooth SDK.

By default, the NCP does not use the event filter.

[in]data_lenLength of data in data
[in]dataThe message for managing event filter
SL_STATUS_OK if successful. Error code otherwise.

◆ sl_bt_user_reset_to_dfu()

void sl_bt_user_reset_to_dfu ( )

Reset the target device to DFU mode from the NCP host. This command is used by specific SDK DFU component on the target device for the functionality related to DFU. Do not use it in other circumstances. This command does not have a response.