2 Replies Latest reply on Sep 2, 2015 5:12 AM by userc_40511

    Cypress Read Event?

    userc_40511

      This question is for a Cypress BLE device configured as a Peripheral with a Custom Profile:

         

      When a Central BLE device writes to a Cypress Peripheral BLE device, the Cypress event handler API function (e.g. EventHandler(uint32 event, void *eventParam)) is called with the CYBLE_EVT_GATTS_WRITE_REQ event set. The value to be written may be acquired from the event handler parameter (e.g. wrReqParam->handleValPair.value.val where wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *)eventParam;). Apparently, the actual write is performed by calling the function CyBle_GattsWriteAttributeValue() and an acknowledgement response is sent to the Central device by calling the function CyBle_GattsWriteRsp(cyBle_connHandle);

         

      QUESTION:

         

      Is there such an event and functions for a Read?

         

      That is, is there, for example, a CYBLE_EVT_GATTS_READ_REQ event and CyBle_GattsReadRsp(cyBle_connHandle) function (or similar)?

         

      I ask this because the Microchip RN4020 has a Real-time Read feature (SR,40000000) that I would like to perform using the Cypress device. Microchip describes that Real-time Read feature bit as follows:

         

      "If set, the device request values from the host MCU through the UART and the host MCU must respond in a timely manner. If cleared, the device reads from the internal RAM of the RN4020 for the characteristic values that were previously set."

         

      Thank you all,

         

      Tim Ball

        • 1. Re: Cypress Read Event?
          rohitk_

          Tim,

             

          In short, no. There is no event generated for Read request sent from a Client device.

             

          The reason is that the read request is handled by the BLE Stack automatically. The only thing to do is to update the Characteristic value by using CyBle_GattsWriteAttributeValue() API and appropriate attribute handler. Whenever the Read request arrives, the stack sends the latest value in its GATT DB (the one updated by application using the API) to the requesting device.

          • 2. Re: Cypress Read Event?
            userc_40511

            Roit:

               

            Thank you for your response and the information.

               

            Appreciatively,

               

            Tim