6 Replies Latest reply on Aug 20, 2015 1:15 PM by userc_40511

    Cypress BLE code needs includes to be included (?)

      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

        • 1. Re: Cypress BLE code needs includes to be included (?)
          JoMe_264151

          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

          • 2. Re: Cypress BLE code needs includes to be included (?)

            Hello Bob:

               

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

               

            Thanks,

               

            Tim

            • 3. Re: Cypress BLE code needs includes to be included (?)
              JoMe_264151

              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

              • 4. Re: Cypress BLE code needs includes to be included (?)

                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

                • 5. Re: Cypress BLE code needs includes to be included (?)
                  JoMe_264151

                  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

                  • 6. Re: Cypress BLE code needs includes to be included (?)

                    Bob:

                       

                    Thank you for the information.

                       

                    I will do as you suggest.

                       

                    Appreciatively,

                       

                    Tim