By default the UUID 2A00 (Device Name) has the access Permission Write and Read i would like to change it to Read only. How can i do this?
By default the UUID 2A00 (Device Name) has the access Permission Write and Read i would like to change it to Read only. How can i do this?
Hi,
The write permission for the device name is set with the sd_ble_gap_device_name_set()
function, when setting the device name. Excerpt from the ble_app_hrs example in SDK 11:
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
Write permissions are set to the variable sec_mode
using the BLE_GAP_CONN_SEC_MODE_SET_OPEN()
macro. See the documentation for sd_ble_gap_device_name_set()
and the list of GAP attribute security requirement setters for the function parameters and available security modes.
To get no write access you should use the BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS()
macro.
Regards, Terje
Hi,
The write permission for the device name is set with the sd_ble_gap_device_name_set()
function, when setting the device name. Excerpt from the ble_app_hrs example in SDK 11:
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
Write permissions are set to the variable sec_mode
using the BLE_GAP_CONN_SEC_MODE_SET_OPEN()
macro. See the documentation for sd_ble_gap_device_name_set()
and the list of GAP attribute security requirement setters for the function parameters and available security modes.
To get no write access you should use the BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS()
macro.
Regards, Terje