Utility functions for applications on SoC.
Functions | |
sl_status_t | sl_bt_wait_event (sl_bt_msg_t *event) |
sl_status_t | sl_bt_pop_event (sl_bt_msg_t *event) |
bool | sl_bt_event_pending (void) |
uint32_t | sl_bt_event_pending_len () |
void | sl_bt_handle_command (uint32_t hdr, void *data) |
void * | sli_bt_get_command_response () |
static sl_bt_msg_t * | sl_bt_get_command_response () |
void | sl_bt_priority_handle (void) |
void | sl_bt_external_signal (uint32_t signals) |
void | sl_bt_send_system_awake () |
void | sl_bt_send_system_error (uint16_t reason, uint8_t data_len, const uint8_t *data) |
uint8_t | sl_bt_is_sensitive_message (uint32_t message_id) |
void | sl_bt_send_rsp_user_message_to_target (uint16_t result, uint8_t data_len, uint8_t *data) |
void | sl_bt_send_evt_user_message_to_host (uint8_t data_len, uint8_t *data) |
Utility functions for applications on SoC.
sl_status_t sl_bt_wait_event | ( | sl_bt_msg_t * | event | ) |
Get the next event that requires processing by user application. In a bare metal application, this blocks application until new event arrives. When RTOS is used, this works the same way as sl_bt_pop_event.
event | the pointer for storing the new event |
sl_status_t sl_bt_pop_event | ( | sl_bt_msg_t * | event | ) |
Get the next event that requires processing by user application. Application is not blocked if no event is waiting.
event | the pointer for storing the new event |
bool sl_bt_event_pending | ( | void |
| ) |
Check whether events are in queue pending for processing. Call sl_bt_wait_event or sl_bt_pop_event to process pending events.
uint32_t sl_bt_event_pending_len | ( |
| ) |
Check whether events are in queue pending for processing and return the next event length in bytes if events are pending. Call sl_bt_wait_event or sl_bt_pop_event to process pending events.
void sl_bt_handle_command | ( | uint32_t | hdr, |
void * | data |
||
) |
Handle an API command in binary format.
This is povided to NCP target applications for processing commands received from NCP transport.
hdr | the command header |
data | the command payload in a byte array |
void* sli_bt_get_command_response | ( |
| ) |
Stack internal function used by sl_bt_get_command_response() API.
|
inlinestatic |
Get the response to the command currently been handled.
This is provided to NCP target applications for processing commands received from NCP transport.
void sl_bt_priority_handle | ( | void |
| ) |
Priority message handler function if user application requires the use of PendSV interrupt.
If scheduler_callback function pointer in configuration struct is something else than NULL, then stack will not install its own PendSV IRQ handler but instead uses callback/handler functions.
When application receives call to the scheduler_callback function it must schedule the call to gecko_priority_handle function to later time to run on high priority thread. This callback may happen inside radio IRQ so processing must not block and has to happen as fast as possible.
Recommended implementation: High priority thread is loop that waits on binary semaphore and calls gecko_priority_handler. The scheduler_callback is simple function that only signals the semaphore.
void sl_bt_external_signal | ( | uint32_t | signals | ) |
Signals stack that external event has happened. Signals can be used to report status change from interrupt context or from other threads to application. Signals are bits that are automatically cleared after application has been notified.
signals | is a bitmask defining active signals that are reported back to the application by system_external_signal-event. |
void sl_bt_send_system_awake | ( |
| ) |
Signals stack to send system_awake event when application received wakeup signal.
void sl_bt_send_system_error | ( | uint16_t | reason, |
uint8_t | data_len, |
||
const uint8_t * | data |
||
) |
Signals stack to send system_error event when in case of an error.
uint8_t sl_bt_is_sensitive_message | ( | uint32_t | message_id | ) |
Tells if a SL_BT_API message is sensitive.
[in] | message_id | the SL_BT_API message identifier |
void sl_bt_send_rsp_user_message_to_target | ( | uint16_t | result, |
uint8_t | data_len, |
||
uint8_t * | data |
||
) |
Sends the NCP host a message whose SL_BT_MSG_ID is gecko_rsp_user_message_to_target_id.
This a utility helping a NCP host and target application to exchange user data. Do not use it in SoC mode.
void sl_bt_send_evt_user_message_to_host | ( | uint8_t | data_len, |
uint8_t * | data |
||
) |
Sends the NCP host a message whose SL_BT_MSG_ID is gecko_evt_user_message_to_host_id.
This a utility helping a NCP host and target application to exchange user data. Do not use it in SoC mode.