Utility Functions#
Utility functions for applications on SoC.
Functions#
Signal the Bluetooth stack that an external event has happened.
Function Documentation#
sl_bt_pop_event#
sl_status_t sl_bt_pop_event (sl_bt_msg_t * event)
N/A | event | the pointer for storing the new event |
Get the next event that requires processing by user application. Application is not blocked if no event is waiting.
Returns
SL_STATUS_OK if a new event is returned, or SL_STATUS_NOT_FOUND if no event is waiting; other value indicates an error occurred
15489
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_event_pending#
bool sl_bt_event_pending (void )
N/A |
Check whether events are in queue pending for processing. Call sl_bt_pop_event to process pending events.
Returns
true if event is pending; false otherwise
15497
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_event_pending_len#
uint32_t sl_bt_event_pending_len (void )
N/A |
Check whether events are in queue pending for processing and return the next event length in bytes if events are pending. Call sl_bt_pop_event to process pending events.
Returns
the next event length if event is pending; 0 otherwise
15506
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_run#
void sl_bt_run ()
Run the Bluetooth stack to process scheduled tasks. Events for user application may be generated as a result of this operation.
15513
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_handle_command#
void sl_bt_handle_command (uint32_t hdr, void * data)
N/A | hdr | the command header |
N/A | data | the command payload in a byte array |
Handle an API command in binary format.
This is provided to NCP target applications for processing commands received from NCP transport. This function is a synonym for a generic BGAPI function sl_bgapi_handle_command. If the NCP application uses an RTOS, use the sequence documented in sl_bgapi_handle_command to handle the BGAPI command in a thread-safe manner.
15527
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_get_command_response#
static sl_bt_msg_t * sl_bt_get_command_response ()
Get the response to the command currently been handled.
This is provided to NCP target applications for processing commands received from NCP transport. This function is a synonym for a generic BGAPI function sl_bgapi_get_command_response.
15536
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_priority_handle#
void sl_bt_priority_handle (void )
N/A |
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.
15559
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_external_signal#
sl_status_t sl_bt_external_signal (uint32_t signals)
Signal the Bluetooth stack that an external event has happened.
N/A | signals | is a bitmask defining active signals that are reported back to the application by system_external_signal-event. |
Signals can be used to report status changes from interrupt context or from other threads to application. Signals are bits that are automatically cleared after application has been notified.
If the Platform Core Interrupt API has been configured to use the CORE_ATOMIC_METHOD_BASEPRI as the implementation method of atomic sections, this function must not be called from an interrupt handler with a priority higher than CORE_ATOMIC_BASE_PRIORITY_LEVEL.
Returns
SL_STATUS_OK if the operation is successful, SL_STATUS_NO_MORE_RESOURCE indicating the request could not be processed due to resource limitation at the moment, or SL_STATUS_INVALID_STATE when the on-demand start feature is used and the stack is currently stopped.
15580
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_send_system_awake#
void sl_bt_send_system_awake ()
Signals stack to send system_awake event when application received wakeup signal.
15586
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_send_system_error#
void sl_bt_send_system_error (uint16_t reason, uint8_t data_len, const uint8_t * data)
N/A | reason | |
N/A | data_len | |
N/A | data |
Signals stack to send system_error event when in case of an error.
15591
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_is_sensitive_message#
uint8_t sl_bt_is_sensitive_message (uint32_t message_header)
[in] | message_header | The header of the SL_BT_API message |
Tells if a SL_BT_API message is sensitive.
Returns
1 if the message is sensitive; otherwise 0
15599
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_send_rsp_user_message_to_target#
void sl_bt_send_rsp_user_message_to_target (uint16_t result, uint8_t data_len, uint8_t * data)
N/A | result | |
N/A | data_len | |
N/A | 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.
15608
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_send_evt_user_message_to_host#
void sl_bt_send_evt_user_message_to_host (uint8_t data_len, uint8_t * data)
N/A | data_len | |
N/A | 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.
15617
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_send_rsp_user_manage_event_filter#
void sl_bt_send_rsp_user_manage_event_filter (uint16_t result)
N/A | result |
Sends the NCP host a message whose SL_BT_MSG_ID is gecko_rsp_user_manage_event_filter_id.
This a utility helping a NCP host and target application to manage event filter. Do not use it in SoC mode.
15626
of file /mnt/raid/workspaces/ws.iUTchugV0/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h