2 Replies Latest reply on Oct 24, 2017 6:58 AM by epr_1639216


              How can i set my characteristic parameters like the function CyBle_IascSetCharacteristicValue, On my own custom service.. thx in advance   
        • 1. Re: BLE CUSTOM SERVICE

          Use CyBle_GattsWriteAttributeValue API.




          Here's an extract from the source code comments:




          ##Function Name: CyBle_GattsWriteAttributeValue








           This function is used to write to the value field of the specified attribute


           in the GATT database of a GATT Server. This is a blocking function. No event


           is generated on calling this function.




           If a peer device connected to the GATT Server initiates a write operation, 


           this function is executed on the GATT Server. During such a call, the function


           checks for the attribute permissions (flags) before executing the write 








          handleValuePair: Pointer to handle value pair of type 




                            * 'handleValuePair.attrHandle' is an input for which value 


                               has to be written.


                            * 'handleValuePair.value.len' is an input parameter for the 


                               length to be written.


                            * 'handleValuePair.value.val' is an input parameter for 


                               data buffer.


                            * 'handleValuePair.actualLen' has to be ignored as it is 


                               unused in this function.


          offset: Offset at which the data (length in number of bytes) is written.


          connHandle: Pointer to the attribute instance handle, of type 




          falgs: Attribute permissions. Allowed values are,




                  * CYBLE_GATT_DB_PEER_INITIATED






           CYBLE_GATT_ERR_CODE_T : Return value indicates if the function succeeded or


           failed. Following are the possible error codes.




           Errors codes                           Description


           ------------                           -----------


            CYBLE_GATT_ERR_NONE                   On successful operation


            CYBLE_GATT_ERR_INVALID_HANDLE         'handleValuePair.attrHandle' 


                                                   is not valid


            CYBLE_GATT_ERR_WRITE_NOT_PERMITTED    Write operation is not 


                                                   permitted on this attribute


            CYBLE_GATT_ERR_INVALID_OFFSET         Offset value is invalid


            CYBLE_GATT_ERR_UNLIKELY_ERROR         Some other error occurred








          CYBLE_GATT_ERR_CODE_T CyBle_GattsWriteAttributeValue




                      CYBLE_GATT_HANDLE_VALUE_PAIR_T * handleValuePair,


                      uint16                          offset,


                      CYBLE_CONN_HANDLE_T       * connHandle,


                      uint8                           flags



          • 2. Re: BLE CUSTOM SERVICE

            I would assume that userc_40593 answered your question