Cypress BLE code needs includes to be included (?)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Cypress World:

   

While trying to determine why the Cypress BLE function CyBle_DissSetCharacteristicValue() was not working, it was discovered that the function CyBle_GattsWriteAttributeValue() was not working because of unknown types as shown in the attached image.

   

After investigating the Cypress BLE code, it was determined that two header files need to be included in the header files as given below:

   

BLE_StackGatt.h needs to include "BLE_Stack.h" after (or before) “cytypes.h” as:

   

#include "cytypes.h"

   

#include "BLE_Stack.h"

   

 

   

BLE_StackGattDb.h needs to include "BLE_StackGatt.h" after (or before) “cytypes.h” as:  

   

#include "cytypes.h"

   

#include "BLE_StackGatt.h"  

   

 

   

Questions:

   

1. Is this the preferred correction?

   

2. How is this correction made permanent so the correction is not overwritten by the Cypress compiler?

   

Thank you,

   

Tim Ball

   

TDB Consulting

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The picture you show has errors flagged by CLANG, an online code checker that is used in Creator.

   

Since you are looking into the generated code there may appear some things going wrong. Try a build and see if there are still any errors flagged, probably not. It sometimes takes too long for Clang to walk though all the #includes so there might something marked in the file-view.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hello Bob:

   

I do a Clean and Build and the errors are still there.

   

Thanks,

   

Tim

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Does that mean the project does not compile? If so, please attach the project here. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hello Bob:

   

Yes, the project does compile with no errors or warnings; however, the errors tagged, as shown in the graphic of the first comment, do remain. Has anyone else noticed that?

   

The original issue related to the Cypress BLE function CyBle_DissSetCharacteristicValue() has been discovered. The BLE Configure/Profiles/Server/Device Information String(s) Length(s) MUST be set to at least the length of the string passed to CyBle_DissSetCharacteristicValue().

   

For example, if the BLE Configure/Profiles/Server/Device Information/Manufacturer Name String Length is set to 11 and the string is set to "Manufacturer" (which has 12 characters) by the following function call:

   

CyBle_DissSetCharacteristicValue(CYBLE_DIS_MANUFACTURER_NAME,

   

                                                          strlen(BLE_DIS_MANUFACTURER),

   

                                                         (uint8 *)BLE_DIS_MANUFACTURER);

   

where: #define BLE_DIS_MANUFACTURER "Manufacturer",

   

the CyBle_DissSetCharacteristicValue() function will fail with a return value of CYBLE_ERROR_INVALID_PARAMETER.

   

Thank you,

   

Tim

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

We all are facing those "errors" flagged by Clang. Believe me, as the successful build shows that are no real errors. Just ignore them and concentrate on your own code and not on the generated files.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Bob:

   

Thank you for the information.

   

I will do as you suggest.

   

Appreciatively,

   

Tim

0 Likes