Modules#
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.
Functions#
Macros#
Function Documentation#
sl_bt_resource_get_status#
sl_status_t sl_bt_resource_get_status (uint32_t * total_bytes, uint32_t * free_bytes)
[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.
1508
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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)
[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 |
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.
1534
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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)
[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
sl_bt_evt_gatt_server_notification_tx_completed - Sent when GATT notifications from the GATT server were transmitted.
1551
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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)
[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.
1568
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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.
1582
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x005f0020
1431
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x015f0020
1432
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x025f0020
1433
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x035f0020
1434
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x045f0020
1435
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_resource_get_status_id#
#define sl_bt_rsp_resource_get_status_idValue:
0x005f0020
1436
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x015f0020
1437
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x025f0020
1438
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x035f0020
1439
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/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_idValue:
0x045f0020
1440
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h