1 Reply Latest reply on Jun 23, 2018 5:13 AM by GyanC_36

    understanding WriteWithoutResponse handling in BLE stack

    GeIo_1586191

      As you know when creating a custom BLE characteristic you can assign which property applies as shown below

       

       

      I've noticed all BLE examples provided use the "Write" property and this is typically handled here within the stackeventhandler routine:

       

              /* This event is received when Central device sends a Write command
                 on an Attribute */
              case CY_BLE_EVT_GATTS_WRITE_REQ:
                  
                  /* Read the write request parameter */
                  writeReqParameter = (cy_stc_ble_gatts_write_cmd_req_param_t *) 
                                      eventParameter;
      
      
                  /* When this event is triggered, the peripheral has received a 
                     write command on the custom  characteristic. Check if command
                     fits any of the custom attributes and update the flag for
                     sending notifications by the respective service */
                  if (SLIDER_CCCD_HANDLE
                      == writeReqParameter->handleValPair.attrHandle)
                  {
                      HandleWriteRequestforSlider(writeReqParameter);
                  }
                  if (BUTTON_CCCD_HANDLE
                      == writeReqParameter->handleValPair.attrHandle)
                  {
                      HandleWriteRequestforButtons(writeReqParameter);
                  }
                  if (RGB_CCCD_HANDLE
                      == writeReqParameter->handleValPair.attrHandle ||
                      CY_BLE_RGB_LED_RGB_LED_CONTROL_CHAR_HANDLE
                      == writeReqParameter->handleValPair.attrHandle)
                  {
                      HandleWriteRequestforRgb(writeReqParameter);
                  }
                  
                  /* Send the response to the write request received. */
                  Cy_BLE_GATTS_WriteRsp(connectionHandle);
                  break;
      

       

       

      With the response sent back using Cy_BLE_GATTS_WriteRsp(connectionHandle);

       

       

      Now I cannot figure out what happens with a WriteWithNoResponse option. I tried this by swapping out Write with a WriteWithNoResponse with GATT characteristic but I could not get this to work.

       

      Is there a different event handler for this, for example, or what do I need to do.

       

      All help appreciated.

       

      Thanks