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:
BLE_StackGattDb.h needs to include "BLE_StackGatt.h" after (or before) “cytypes.h” as:
1. Is this the preferred correction?
2. How is this correction made permanent so the correction is not overwritten by the Cypress compiler?
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.
I do a Clean and Build and the errors are still there.
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.
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:
where: #define BLE_DIS_MANUFACTURER "Manufacturer",
the CyBle_DissSetCharacteristicValue() function will fail with a return value of CYBLE_ERROR_INVALID_PARAMETER.
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.
Thank you for the information.
I will do as you suggest.