Resource Report#

Resource Report.

Commands and events in this class can be used to query and receive the memory buffer usage status. The memory buffer is used by the Bluetooth stack for storing application data (e.g., API commands and events), user data over Bluetooth connections, advertising, scanning, etc. Total buffer size is defined by the application using the SL_BT_CONFIG_BUFFER_SIZE configuration. The Bluetooth stack does not partition the buffer, instead, the buffer is a shared resource for all features. Therefore, the available memory for one feature could be affected by another feature in simultaneous use cases. This API class provides a utility for application to get some insight of the buffer usage. As allocations in the memory buffer have overhead, the actual amount of memory that can be used for user data is less than a reported free memory amount.

Modules#

Connection TX status flags

sl_bt_evt_resource_status

Functions#

sl_status_t
sl_bt_resource_get_status(uint32_t *total_bytes, uint32_t *free_bytes)
sl_status_t
sl_bt_resource_set_report_threshold(uint32_t low, uint32_t high)
sl_status_t
sl_status_t
sl_bt_resource_get_connection_tx_status(uint8_t connection, uint16_t *flags, uint16_t *packet_count, uint32_t *data_len)

Function Documentation#

sl_bt_resource_get_status#

sl_status_t sl_bt_resource_get_status (uint32_t * total_bytes, uint32_t * free_bytes)
Parameters
[out]total_bytes

The number of total bytes in the memory buffer

[out]free_bytes

The number of free bytes in the memory buffer

Get the present memory buffer usage status.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 1596 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_resource_set_report_threshold#

sl_status_t sl_bt_resource_set_report_threshold (uint32_t low, uint32_t high)
Parameters
[in]low

The low threshold of free bytes in the memory buffer, or 0 to disable the reporting

[in]high

A non-zero value as the high threshold that must be greater than parameter low, or 0 for not reporting the status for high threshold

Set low and high thresholds of memory buffer usage reports. Value 0 in parameter low for the low threshold disables the reporting, and a non-zero value in low enables the reporting.

When the reporting is enabled, event sl_bt_evt_resource_status will be generated to report the status when the free buffer amount decreases and crosses the low threshold, and later another event will be generated if the free buffer amount increases and crosses the high threshold. If only the high threshold is crossed but the low threshold isn't, no event will be generated.

By default, low and high threshold values are 0, i.e., no report event is generated.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 1622 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_resource_enable_connection_tx_report#

sl_status_t sl_bt_resource_enable_connection_tx_report (uint16_t packet_count)
Parameters
[in]packet_count

The maximum number of data packets to track on a connection

Enable tracking and reporting data packet TX status of future new connections. Existing connections are not affected by this command.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


Definition at line 1639 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_resource_get_connection_tx_status#

sl_status_t sl_bt_resource_get_connection_tx_status (uint8_t connection, uint16_t * flags, uint16_t * packet_count, uint32_t * data_len)
Parameters
[in]connection

Connection handle

[out]flags

Flags that indicate the status of connection TX packet reporting. This value is a bitmask of Connection TX status flags.

[out]packet_count

Number of data packets in the TX queue waiting to be transmitted

[out]data_len

Total number of bytes of data packets in the TX queue

Get the data packet TX status of a connection.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 1656 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_resource_disable_connection_tx_report#

sl_status_t sl_bt_resource_disable_connection_tx_report ()

Disable tracking and reporting data packet TX status of future new connections.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 1670 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

Macro Definition Documentation#

sl_bt_cmd_resource_get_status_id#

#define sl_bt_cmd_resource_get_status_id
Value:
0x005f0020

Definition at line 1519 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_resource_set_report_threshold_id#

#define sl_bt_cmd_resource_set_report_threshold_id
Value:
0x015f0020

Definition at line 1520 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_resource_enable_connection_tx_report_id#

#define sl_bt_cmd_resource_enable_connection_tx_report_id
Value:
0x025f0020

Definition at line 1521 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_resource_get_connection_tx_status_id#

#define sl_bt_cmd_resource_get_connection_tx_status_id
Value:
0x035f0020

Definition at line 1522 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_resource_disable_connection_tx_report_id#

#define sl_bt_cmd_resource_disable_connection_tx_report_id
Value:
0x045f0020

Definition at line 1523 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_resource_get_status_id#

#define sl_bt_rsp_resource_get_status_id
Value:
0x005f0020

Definition at line 1524 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_resource_set_report_threshold_id#

#define sl_bt_rsp_resource_set_report_threshold_id
Value:
0x015f0020

Definition at line 1525 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_resource_enable_connection_tx_report_id#

#define sl_bt_rsp_resource_enable_connection_tx_report_id
Value:
0x025f0020

Definition at line 1526 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_resource_get_connection_tx_status_id#

#define sl_bt_rsp_resource_get_connection_tx_status_id
Value:
0x035f0020

Definition at line 1527 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_resource_disable_connection_tx_report_id#

#define sl_bt_rsp_resource_disable_connection_tx_report_id
Value:
0x045f0020

Definition at line 1528 of file /mnt/raid/workspaces/ws.XK183xwsq/overlay/gsdk/protocol/bluetooth/build_release/bt_api/sw/bgapi/inc/sl_bt_api.h