nrf-softdevice-s112

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gap_device_name_set(
p_write_perm: *const ble_gap_conn_sec_mode_t,
p_dev_name: *const u8,
len: u16
) -> u32
Expand description

@brief Set GAP device name.

@note If the device name is located in application flash memory (see @ref ble_gap_cfg_device_name_t), it cannot be changed. Then @ref NRF_ERROR_FORBIDDEN will be returned.

@param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t. @param[in] p_dev_name Pointer to a UTF-8 encoded, non NULL-terminated string. @param[in] len Length of the UTF-8, non NULL-terminated string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN).

@retval ::NRF_SUCCESS GAP device name and permissions set successfully. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. @retval ::NRF_ERROR_FORBIDDEN Device name is not writable.