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

difference b/w attribute write/read permission with respect to characteristic properties

Hi, I wrote a sample application to remotely control and led on nrf51822_xxaa module. in the application I was able to provide configuration to the characteristics as well as attributes using the char_props for the characteristics (for options like write/read/notify etc.) and also read/write permission to the attributes using read_perm and write_perm in ble_gatts_attr_md_t structure during addition of characteristics to the service. I tried turning on and off the leds with following settings and results:

image description

actually the control over attribute in characteristics is independent of read_perm and write_perm in ble_gatts_attr_md_t and dependent of char_props for the characteristics. why is it so? and if so, what is the significance of the read_perm and write_perm in ble_gatts_attr_md_t.

Parents
  • You have attribute permissions and characterisitc properties, not characteristic permissions.

    Attribute permissions are described in Vol. 3, Part F, Section 3.2.5, and Characteristic properties are described in Vol. 3, Part G, Section 3.3.1.1 in the Bluetooth Core Specification v4.2.

    The characteristic properties determine how the characterisitic value can be used, this information is given to the GATT client as a reference.

    The attribute permissions, or the attribute access permissions specifies that it may be read and/or written, this information is not given to the GATT client.

    If you try to write to an attribute that only is readable, you would get an Write Not Permitted error.

    If you try to write to an attribute that is writeable, you would be able to write to it regardless of what the characteristic properties are.

    This is assuming that none of the other type of permissions are set, and that the device with GATT server doesn't check the characteristic permissions first.

Reply
  • You have attribute permissions and characterisitc properties, not characteristic permissions.

    Attribute permissions are described in Vol. 3, Part F, Section 3.2.5, and Characteristic properties are described in Vol. 3, Part G, Section 3.3.1.1 in the Bluetooth Core Specification v4.2.

    The characteristic properties determine how the characterisitic value can be used, this information is given to the GATT client as a reference.

    The attribute permissions, or the attribute access permissions specifies that it may be read and/or written, this information is not given to the GATT client.

    If you try to write to an attribute that only is readable, you would get an Write Not Permitted error.

    If you try to write to an attribute that is writeable, you would be able to write to it regardless of what the characteristic properties are.

    This is assuming that none of the other type of permissions are set, and that the device with GATT server doesn't check the characteristic permissions first.

Children
Related