S145 SoftDevice for nRF54LS05 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_gatts_sys_attr_get()

uint32_t sd_ble_gatts_sys_attr_get ( uint16_t conn_handle,
uint8_t * p_sys_attr_data,
uint16_t * p_len,
uint32_t flags )

#include <ble_gatts.h>

Retrieve persistent system attribute information from the stack.

This call is used to retrieve information about values to be stored persistently by the application during the lifetime of a connection or after it has been terminated. When a new connection is established with the same bonded device, the system attribute information retrieved with this function should be restored using using sd_ble_gatts_sys_attr_set. If retrieved after disconnection, the data should be read before a new connection established. The connection handle for the previous, now disconnected, connection will remain valid until a new one is created to allow this API call to refer to it. Connection handles belonging to active connections can be used as well, but care should be taken since the system attributes may be written to at any time by the peer during a connection's lifetime.

Note
When the BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned.
When the BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned.
Relevant Message Sequence Charts
GATTS System Attributes Handling: Bonded Peer
Parameters
[in]conn_handleConnection handle of the recently terminated connection.
[out]p_sys_attr_dataPointer to a buffer where updated information about system attributes will be filled in. The format of the data is described in User memory layout for System Attributes. NULL can be provided to obtain the length of the data.
[in,out]p_lenSize of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data.
[in]flagsOptional additional flags, see System Attribute Flags
Return values
NRF_SUCCESSSuccessfully retrieved the system attribute information.
BLE_ERROR_INVALID_CONN_HANDLEInvalid Connection Handle.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_INVALID_PARAMInvalid flags supplied.
NRF_ERROR_DATA_SIZEThe system attribute information did not fit into the provided buffer.
NRF_ERROR_NOT_FOUNDNo system attributes found.