This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I have a question about configuration of charateristic value R/W permission.

I saw following code configuring about permission of charateristic value R/W.

it's in uart example of SDK 11.0.0.

static uint32_t tx_char_add (ble_nus_t * p_nus, const ble_nus_init_t * p_nus_init){
   ...
   BLE_GAP_CONN_SEC_MODE_SET_OPEN(&attr_md.read_perm);
   BLE_GAP_CONN_SEC_MODE_SET_OPEN(&attr_md.write_perm);
   ...
}

it was not a setting about whether R/W is possible or not.

So, is it the setting about connection security mode that R/W is possible?

Parents
  • FormerMember
    0 FormerMember

    Yes, part of the security for a device can be to limit the read/write properties.

    attr_md sets the actual properties for a characteristic (the actual accessibility). char_md sets the properties that will be found during service discovery. For the properties to be in conformance with the Bluetooth Spec, the attr_md properties and the char_md properties should be the same.

    Update March 17th 2017:

    image description

    When adding a characteristic, both characteristic metadata and attribute metatdata should be set. As stated in the documentation for the characteristic metatdata --> characteristic properties (ble_gatts_char_md_t --> ble_gatt_char_props_t), it is only the properties of the characteristic.

    The attribute metadata (ble_gatts_attr_md_t) contains the actual permissions.

Reply Children
No Data
Related