#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
-
- Parameters
-
| [in] | conn_handle | Connection handle of the recently terminated connection. |
| [out] | p_sys_attr_data | Pointer 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_len | Size of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data. |
| [in] | flags | Optional additional flags, see System Attribute Flags |
- Return values
-