This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can i change the write Read permission of UUID 2A00?

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?

Parents
  • 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

Reply
  • 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

Children
No Data
Related