- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Best procedure would be to create a support case. That will ensure that a Cypress engineer will have a look at and when there is an error to have it corrected. Remember that this is a developer forum, we cannot change the sources.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Bob:
I will do as you suggest and then post their response.
Thanks,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For those who access the BLE GATT Database, a Cypress Support Case was created for the error described above and the response follows:
Hi Tim,
Our software team have also confirmed this bug. It should be cyBle_gattDB[(handle)-1u].attHandle. We will be fixing this in the next version of PSoC Creator. We really appreciate your efforts in reporting this bug.
The Workaround is to use direct access to cyBle_gattDB to get attribute handle: cyBle_gattDB[(handle)-1u].attHandle
Thanks and Regards
Mahesh