4 Replies Latest reply on May 31, 2018 7:51 AM by e.pratt_1639216

    CYBLE_ERROR_INVALID_OPERATION with CyBle_GattcWriteCharacteristicValue

    pmegharaj_1745581

      I'm trying to write to a BLE attribule handle from a GATT client to GATT server using CyBle_GattcWriteCharacteristicValue() function. This works fine if the attribute on the server has only a single field. But the function returns CYBLE_ERROR_INVALID_OPERATION error when the attribute has multiple fields.

       

      For example: This works fine if the Attribute has single field...

              GATTCWriteReq.attrHandle = ATTR_HANDLE;

              GATTCWriteReq.value.len = 4;               //4 bytes

              GATTCWriteReq.value.val = (uint8_t*)&someValue;

              bleApiResult = CyBle_GattcWriteCharacteristicValue(cyBle_connHandle, &GATTCWriteReq);

       

       

      The Attribute that I'm unable to write has 2 fields of 2 bytes. I have tried changing the GATTCWriteReq.value.len = 2 but it still does not work. I have also double checked that the attribute on the sever allows both read and write features.

      Any suggestions?

       

      Thank you for your help.