NCP Interface#

Component that provides the Bluetooth Network Co-Processor (NCP) communication interface. This is a No-Code component.

Enumerations#

enum
SL_NCP_ERROR_RUNTIME = 0
SL_NCP_ERROR_RECEIVE = 1
SL_NCP_ERROR_TIMER = 2
SL_NCP_ERROR_ENCRYPT = 3
SL_NCP_ERROR_BGAPI_LOCK = 4
}

NCP error type.

Functions#

void
void
sl_ncp_user_cmd_message_to_target_rsp(sl_status_t result, uint8_t len, uint8_t *data)
void
sl_ncp_user_evt_message_to_host(uint8_t len, uint8_t *data)
bool
sl_ncp_local_evt_process(sl_bt_msg_t *evt)
bool
void
sl_ncp_on_error(sl_ncp_error_t error, sl_status_t status)

Macros#

#define
#define
#define
SL_NCP_TASK_PRIO APP_RTA_PRIORITY_NORMAL
#define

Enumeration Documentation#

sl_ncp_error_t#

sl_ncp_error_t

NCP error type.

Enumerator
SL_NCP_ERROR_RUNTIME
SL_NCP_ERROR_RECEIVE
SL_NCP_ERROR_TIMER
SL_NCP_ERROR_ENCRYPT
SL_NCP_ERROR_BGAPI_LOCK

Definition at line 55 of file common/ncp/sl_ncp.h

Function Documentation#

sl_ncp_init#

void sl_ncp_init (void )
Parameters
N/A

NCP initialization function.


Definition at line 66 of file common/ncp/sl_ncp.h

sl_ncp_rta_ready#

void sl_ncp_rta_ready (void )
Parameters
N/A

NCP runtime ready.


Definition at line 71 of file common/ncp/sl_ncp.h

sl_ncp_user_cmd_message_to_target_cb#

void sl_ncp_user_cmd_message_to_target_cb (void * data)
Parameters
[in]data

Data received from NCP through UART.

User command (message_to_target) handler callback.

Handle user defined commands received from NCP-host.


Definition at line 80 of file common/ncp/sl_ncp.h

sl_ncp_user_cs_cmd_message_to_target_cb#

void sl_ncp_user_cs_cmd_message_to_target_cb (const void * data)
Parameters
[in]data

Data received from NCP through UART.

CS user command (message_to_target) handler callback.

Handle CS defined user commands received from NCP-host.


Definition at line 89 of file common/ncp/sl_ncp.h

sl_ncp_user_cmd_message_to_target_rsp#

void sl_ncp_user_cmd_message_to_target_rsp (sl_status_t result, uint8_t len, uint8_t * data)
Parameters
[out]result

Result of the response to the command received.

[out]len

Message length.

[out]data

Data to send to NCP.

Send user command (message_to_target) response.

Send response to user defined (message_to_target) command to NCP-host.


Definition at line 100 of file common/ncp/sl_ncp.h

sl_ncp_user_evt_message_to_host#

void sl_ncp_user_evt_message_to_host (uint8_t len, uint8_t * data)
Parameters
[out]len

Message length.

[out]data

Data to send to NCP.

Send user event (message_to_host).

Send user defined (message_to_host) event to NCP-host.


Definition at line 112 of file common/ncp/sl_ncp.h

sl_ncp_local_evt_process#

bool sl_ncp_local_evt_process (sl_bt_msg_t * evt)
Parameters
[in]evt

Bluetooth event.

Local event processor for handling Bluetooth events in the application.

Note

  • This function can be implemented in the application.


Definition at line 123 of file common/ncp/sl_ncp.h

sl_ncp_local_common_evt_process#

bool sl_ncp_local_common_evt_process (sl_bt_msg_t * evt)
Parameters
[in]evt

Bluetooth event.

Process Bluetooth events locally using template contribution.

Note


Definition at line 135 of file common/ncp/sl_ncp.h

sl_ncp_on_error#

void sl_ncp_on_error (sl_ncp_error_t error, sl_status_t status)
Parameters
N/Aerror

error type

N/Astatus

status code

NCP runtime error callback.

Note

  • The error callback is called when an error has occurred in the runtime context. The weak implementation asserts. It can be overridden in user code by adding a strong implementation.


Definition at line 175 of file common/ncp/sl_ncp.h

Macro Definition Documentation#

SL_NCP_CMD_BUF_SIZE#

#define SL_NCP_CMD_BUF_SIZE
Value:
(260)

Definition at line 48 of file common/ncp/config/sl_ncp_config.h

SL_NCP_EVT_BUF_SIZE#

#define SL_NCP_EVT_BUF_SIZE
Value:
(260)

Definition at line 53 of file common/ncp/config/sl_ncp_config.h

SL_NCP_CMD_TIMEOUT_MS#

#define SL_NCP_CMD_TIMEOUT_MS
Value:
(500)

Definition at line 58 of file common/ncp/config/sl_ncp_config.h

SL_NCP_TASK_PRIO#

#define SL_NCP_TASK_PRIO
Value:
APP_RTA_PRIORITY_NORMAL

Definition at line 72 of file common/ncp/config/sl_ncp_config.h

SL_NCP_TASK_STACK#

#define SL_NCP_TASK_STACK
Value:
1024

Definition at line 77 of file common/ncp/config/sl_ncp_config.h

SL_NCP_WAIT_FOR_GUARD#

#define SL_NCP_WAIT_FOR_GUARD
Value:
10

Definition at line 82 of file common/ncp/config/sl_ncp_config.h

SL_NCP_EMIT_SYSTEM_ERROR_EVT#

#define SL_NCP_EMIT_SYSTEM_ERROR_EVT
Value:
0

Definition at line 92 of file common/ncp/config/sl_ncp_config.h