This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GATT_PROP_READ and GATT_PERMIT_READ?

Hi,

          GATT_PROP_READ and GATT_PERMIT_READ ?

         Anybody, who can tell what the difference between them?

        Looking forward to your reply.

        Best Regards!

  • Hi Jun,

    I am also not very clear but what I have known is that GATT_PERMIT_READ is to be used with characteristic value and  GATT_PROP_READ to be used with characteristic properties.

    maharjanbk

  • Both of these are for bitmapping.

    GATT_PERMIT_READ sets the permissions in the permissions field of the gattAttribute_t struct. GATT_PROP_READ is used to set a characteristic value that is communicated to other devices. This is a loose understanding and I would appreciate being validated or disprove by a better source 

    Not that the GATT_PROP_READ does NOT set the actual permissions. You can have a device say its readable via properties yet not actually allow reads.  I assume this is a bug an will be fixed in future revisions

  • Peter has it right, except that there is no bug.  

    At the risk of TMI:

    The GATT specification defines two required attributes for a characteristic:
    - a characteristic declaration, and
    - a characteristic value declaration
    These declarations are attributes defined per the BT ATT specification. Additional declarations/attributes for the characteristic are optional.

    In the TI environment, a characteristic definition looks something like this (excerpted from simpleGATTprofile.c):

    static uint8 simpleProfileChar1Props = GATT_PROP_READ | GATT_PROP_WRITE;

    // Characteristic 1 Declaration
    {
    { ATT_BT_UUID_SIZE, characterUUID },
    GATT_PERMIT_READ,
    0,
    &simpleProfileChar1Props
    },

    // Characteristic Value 1
    {
    { ATT_BT_UUID_SIZE, simpleProfilechar1UUID },
    GATT_PERMIT_READ | GATT_PERMIT_WRITE,
    0,
    &simpleProfileChar1
    },

    In the Characteristic Declaration, the value field (simpleProfileChar1Props) determines how the Characteristic Value in the following declaration can be used.

    In the Characteristic Value Declaration, the permissions field (e.g. GATT_PERMIT_READ) is defined in the BT spec as "Higher layer profile or implementation specific".  Since the effect of these permissions in various BLE stacks is uncertain, it would seem prudent to make these permissions consistent with the Characteristic Declaration properties.

  • If under one "Characteristic Declaration", I have multiple "Characteristic Value Declarations", and each value has different permissions. Then what will go in the value field (simpleProfileChar1Props) in Characteristic Declaration ? 

  • The value field should have a pointer to the the value.  That's why Richard's example has &simpleProfileChar1  instead of simpleProfileChar1