3 Replies Latest reply on Sep 25, 2015 5:06 AM by tdbconsulting_1416776

    Cypress API BLE_gatt.h Macro Error?

    tdbconsulting_1416776

      Hello Cypress World:

         

      Evidently, the Cypress API macro below, that resides in the Cypress API file BLE_gatt.h, is erroneous:

         

      /* Macro to get start handle of attribute

         

         Start handle is only meaningful for characteristic and

         

         service declaration */

         

      #define CYBLE_GATT_DB_GET_START_HANDLE(handle)\

         

              cyBle_gattDB[(handle)-1u].connHandle

         

       

         

      The cyBle_gattDB variable is a CYBLE_GATTS_DB_T data type as for example:  const CYBLE_GATTS_DB_T cyBle_gattDB[0x34u] in BLE_gatt.c.

         

      The CYBLE_GATTS_DB_T does not have a connHandle element but does have an attHandle element as shown below:

         

       

         

      /* GATT database structure used in the GAP Server */

         

      typedef struct

         

      {

         

            /* Start Handle: Act as an index for querying BLE GATT database */

         

          uint16                    attHandle;

         

          

         

          /* UUID: 16 bit UUID type for an attribute entry, for 32 bit and

         

             128 bit UUIDs the last 16 bits should be stored in this entry

         

             GATT DB access layer shall retrieve complete 128 bit UUID from

         

             CYBLE_GATTS_ATT_GENERIC_VAL_T structure. */

         

          uint16                    attType;

         

          

         

          /* The permission bits are clubbed in to a 32-bit field. These

         

              32-bits can be grouped in to 4 bytes. The lowest significant byte

         

              is byte 0 (B0) and the most significant byte is byte 3 (B3). The

         

              bytes where the permissions have been grouped is as given below.

         

                 * Attribute permissions (B0)

         

               * Characteristic permissions (B1)

         

               * Implementation specific permission (B3, B2)

         

             */

         

          uint32                    permission;

         

          

         

          /* Attribute end handle, indicating logical boundary of given attribute. */

         

          uint16                    attEndHandle;

         

          

         

          /* Attribute value format, it can be one of following:

         

              * uint16 16bit - UUID for 16bit service & characteristic declaration

         

              * CYBLE_GATTS_ATT_GENERIC_VAL_T attFormatValue - Buffer containing 32 bit

         

                  or 128 bit UUID values for service & charactertistic declaration

         

              * CYBLE_GATTS_ATT_GENERIC_VAL_T attFormatValue - Buffer contraining generic

         

                  char definition value, or generic descriptor values

         

           */

         

            CYBLE_GATTS_ATT_VALUE_T       attValue;

         

       } CYBLE_GATTS_DB_T;

         

       

         

      Is it true that the line of code below in the Cypress API file BLE_gatt.h needs to be changed

         

      FROM:

         

              cyBle_gattDB[(handle)-1u].connHandle

         

      TO:

         

              cyBle_gattDB[(handle)-1u].attHandle

         

       

         

      Thank you,

         

      Tim