Function nrf_softdevice_s132::sd_ble_gatts_sys_attr_get
source · pub unsafe fn sd_ble_gatts_sys_attr_get(
conn_handle: u16,
p_sys_attr_data: *mut u8,
p_len: *mut u16,
flags: u32
) -> u32
Expand description
@brief Retrieve persistent system attribute information from the stack.
@details 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 @ref 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 @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned. @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned.
@mscs @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC} @endmscs
@param[in] conn_handle Connection handle of the recently terminated connection. @param[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 @ref BLE_GATTS_SYS_ATTRS_FORMAT. NULL can be provided to obtain the length of the data. @param[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. @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS
@retval ::NRF_SUCCESS Successfully retrieved the system attribute information. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied. @retval ::NRF_ERROR_DATA_SIZE The system attribute information did not fit into the provided buffer. @retval ::NRF_ERROR_NOT_FOUND No system attributes found.