S115 SoftDevice for nRF54L15/nRF54L10/nRF54L05 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_gatts_sys_attr_set()

uint32_t sd_ble_gatts_sys_attr_set ( uint16_t conn_handle,
uint8_t const * p_sys_attr_data,
uint16_t len,
uint32_t flags )

#include <ble_gatts.h>

Update persistent system attribute information.

Supply information about persistent system attributes to the stack, previously obtained using sd_ble_gatts_sys_attr_get. This call is only allowed for active connections, and is usually made immediately after a connection is established with an known bonded device, often as a response to a BLE_GATTS_EVT_SYS_ATTR_MISSING.

p_sysattrs may point directly to the application's stored copy of the system attributes obtained using sd_ble_gatts_sys_attr_get. If the pointer is NULL, the system attribute info is initialized, assuming that the application does not have any previously saved system attribute data for this device.

Note
The state of persistent system attributes is reset upon connection establishment and then remembered for its duration.
If this call returns with an error code different from NRF_SUCCESS, the storage of persistent system attributes may have been completed only partially. This means that the state of the attribute table is undefined, and the application should either provide a new set of attributes using this same call or reset the SoftDevice to return to a known state.
When the BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be modified.
When the BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be modified.
Relevant Message Sequence Charts
GATTS Handle Value Indication or Notification with System Attributes Missing
GATTS System Attributes Handling: Unknown Peer
GATTS System Attributes Handling: Bonded Peer
Parameters
[in]conn_handleConnection handle.
[in]p_sys_attr_dataPointer to a saved copy of system attributes supplied to the stack, or NULL.
[in]lenSize of data pointed by p_sys_attr_data, in octets.
[in]flagsOptional additional flags, see System Attribute Flags
Return values
NRF_SUCCESSSuccessfully set the system attribute information.
BLE_ERROR_INVALID_CONN_HANDLEInvalid Connection Handle.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_INVALID_STATEInvalid Connection State.
NRF_ERROR_INVALID_PARAMInvalid flags supplied.
NRF_ERROR_INVALID_DATAInvalid data supplied, the data should be exactly the same as retrieved with sd_ble_gatts_sys_attr_get.
NRF_ERROR_NO_MEMNot enough memory to complete operation.