6 Replies Latest reply on Dec 15, 2015 11:24 PM by henryubnt

    LEGATTDB_PERM_AUTH_READABLE?

      Hi,

      Please kindly provide an example for the characteristic permission :"LEGATTDB_PERM_AUTH_READABLE". I have done a lot of search but can not understand how to use it in BCM20737.

       

      Thanks.

        • 1. Re: LEGATTDB_PERM_AUTH_READABLE?

          Hello Henry,

           

          As you can see the GATT database shown here in the picture below:

           

           

          The Header information shows this is the Spec:

           

           

          #define LEGATTDB_PERM_NONE (0x00)

           

          #define LEGATTDB_PERM_VARIABLE_LENGTH (0x1<<0)

           

          #define LEGATTDB_PERM_READABLE (0x1<<1)

           

          #define LEGATTDB_PERM_WRITE_CMD (0x1<<2)

           

          #define LEGATTDB_PERM_WRITE_REQ (0x1<<3)

           

          #define LEGATTDB_PERM_AUTH_READABLE (0x1<<4)

           

          #define LEGATTDB_PERM_RELIABLE_WRITE (0x1<<5)

           

          #define LEGATTDB_PERM_AUTH_WRITABLE (0x1<<6)

           

          However, we don't have any examples in our SDK.

           

          JT

          • 2. Re: LEGATTDB_PERM_AUTH_READABLE?

            j.t wrote:

             

            However, we don't have any examples in our SDK.

             

            JT

             

            That's why I requested here with this topic, the BCM SDK usually used LEGATTDB_PERM_READABLE, LEGATTDB_PERM_WRITE_CMD and LEGATTDB_PERM_WRITE_REQ as characteristic permission of your database, I want to know the usage about LEGATTDB_PERM_AUTH_READABLE, LEGATTDB_PERM_RELIABLE_WRITE and LEGATTDB_PERM_AUTH_WRITABLE in BCM20737.

            Please kindly provide some helpful information, thanks.

            • 3. Re: LEGATTDB_PERM_AUTH_READABLE?
              VictorZ_46

              Following is a sample how to modify hello_sensor with required property

               

              CHARACTERISTIC_UUID128 (0x0029, HANDLE_HELLO_SENSOR_VALUE_NOTIFY, UUID_HELLO_CHARACTERISTIC_NOTIFY,
                                     LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY | LEGATTDB_CHAR_PROP_INDICATE,

              #ifdef LINK_ENCRYPTION_REQUIRED

                                     LEGATTDB_PERM_READABLE | LEGATTDB_PERM_AUTH_READABLE,

              #else

                                     LEGATTDB_PERM_READABLE,

              #endif

              • 4. Re: LEGATTDB_PERM_AUTH_READABLE?

                Hi JT,

                I know that setting, the question is, is there any other action we need to take care of for the flag enabled?

                 

                For example,

                If we set the LEGATTDB_PERM_AUTH_WRITABLE or LEGATTDB_PERM_RELIABLE_WRITE to the characteristic, what is the extra code we should add into the write handle callback?

                • 5. Re: LEGATTDB_PERM_AUTH_READABLE?
                  VictorZ_46

                  You got lucky today.  No more action required on the application side.  If peer decides to read/write characteristic over the unencrypted link, the error response with appropriate result code will be generated by the stack. 

                  • 6. Re: LEGATTDB_PERM_AUTH_READABLE?

                    Hi VictorZ_46,

                    Thanks, I got some related example code in SDK 2.2.2 and tested. It works.