7 Replies Latest reply on Nov 20, 2018 10:39 PM by PY_21

    Overwrite characteristic or user description value

      Hello,

       

      I am developing BLE peripheral and server with PSoC6.

       

      How can I overwrite initial value of characteristic decoration or user description in PSoC6 with "write characteristic value" from central and cliant?

       

      Best regards,

        • 1. Re: Overwrite characteristic or user description value
          PY_21

          Hello,

           

          The API Cy_BLE_GATTC_WriteCharacteristicDescriptors() is used by GATT client application to write a characteristic descriptor value to a peer GATT Server when the GATT Client application knows the characteristic descriptor handle.

          Internally, Write Request is sent to the peer GATT Server. If write operation is successful GATT server sends Write Response. This Response results in the event CY_BLE_EVT_GATTC_WRITE_RSP at GATT Client application.

           

           

          Thanks,

          P Yugandhar.

          • 2. Re: Overwrite characteristic or user description value

            Hello,

             

            Thanks.

            Actually, I have tried to send write request by using BLE dongle of PSoC6 evaluation board and CySmart. Then, PSoC6 recieved the a value of the handle value from CySmart. Also, eventParam had the written value by CySmart but the value was not stocked parmanently because the eventParma points a RAM area and when I reset PSoC6, the value from CySmart had gone.

             

            After recieving the value by write comand, FW have to stock Flash area which the initial characteristic value locate at.

            The initial charactaristic value is defined with "static uint8_t cy_ble_attValues = {....}" in BLE_config generated by PSoC Creator.

             

            Please let me know the way.

             

            Best regards,

            • 3. Re: Overwrite characteristic or user description value
              PY_21

              Hello,

               

              The API Cy_BLE_GATTS_WriteAttributeValuePeer() is used to write to the value field of the specified attribute in the GATT database of a GATT Server by a peer device. When we write any value from the Cysmart this API has to be used to update in the GATT DB. This won't be updated in the flash and also as soon as you reset the device the GATT DB will also gets reset.

               

               

              Thanks,

              P Yugandhar.

              • 4. Re: Overwrite characteristic or user description value

                Hello,

                 

                Updating BLE perioheals in markets, we have to change the initial vale in the Characteristic User Description.

                I can understood update the value the API but after update we will reset or power down the BLE device because we use PSoC6 with using energy havesting device.

                 

                Although I can overwrite the value of cy_ble_attValues with Flash write API, PSoC6 have to call Cy_BLE_ProcessEvents API during Interval time, So do I deleate and write the Flash in the time?

                 

                Best regards,

                • 5. Re: Overwrite characteristic or user description value
                  PY_21

                  Hello,

                   

                  If you are storing in Flash, make sure you are not overwriting other program area. This would be better, whenever if you updated any values in the GATT DB you can store those values in the SFLASH region using the API CySysSFlashWriteUserRow() which writes data to a row of SFlash user configurable area. When the device is restarted (after reset or power off) you can get stored data from SFLASH and then update into the GATT DB.

                   

                  Thanks,

                  P Yugandhar.

                  • 6. Re: Overwrite characteristic or user description value

                    Hello,

                     

                    There is trim value and flash boot in SFLASH. I think that the other area could be user configurable area.

                    But I can not find the area info of the user configurable.

                     

                    Please let me know address space of the user configurable area.

                     

                    Best regards,

                    • 7. Re: Overwrite characteristic or user description value
                      PY_21

                      Hello,

                       

                      Sorry the delayed response.

                      There are three rows in SFLASH that is available for user data - 0x16000A00, 0x16000C00 and 0x16000E00 (total 512 x 3 = 1536 bytes).

                      You can also store the data using the Emulated EEPROM area for this purpose. Please see CE195313 for details.

                       

                      Thanks,

                      P Yugandhar.