My sensor is a CC2650 component but my master is the CY5677 dongle. I'm able to read datas from this sensor from an android application but I'm unable to read it from the dongle with the project linked by Madhu Sudhan (thank to him) at: http://www.cypress.com/forum/proc-ble/cysmart-api-c-example?page=1
I tried to read it from CySmart and it works I have what is show in the attached picture.
So in the goal to be able to write on this characteristic with the example given I changed the CharHandle and the CCCDHandle to :
ushort CharHandle = 0x001E;
ushort CCCDHandle = 0x001F;
But when I launch it I'm able to read it but not write on this characteristic. When I clic on Write, I can see on the debugger the error is : BLE_ERROR_GATT_INVALID_ATTRIBUTE_LEN. I tried to write "A", "4" and "04" but nothing worked.
Does someone can help me with it ? I read the good value so it seems I'm reading the good characteristic but I'm able to write on it with the android application but not with this application, why ?
Can you please modify the write button click code as follows:
private void Write_Button_Click(object sender, EventArgs e)
AutoResetEvent sync = new AutoResetEvent(false);
CyApiErr err = CyApiErr.OK;
// Setup the descriptor write handler
GATTClientEventCallback.CharacteristicWriteHandler = (CyConnectResult, status) =>
if (status != CyStatus.BLE_STATUS_OK)
err = new CyApiErr("Failed to Write: Reason: " + status.ToString());
var WriteByte = new byte;
WriteByte = BitConverter.GetBytes(int.Parse(WriteTextBox.Text, System.Globalization.NumberStyles.HexNumber));
Array.Resize(ref WriteByte, 1);
// Initiate write descriptor request to the CCCD
err = GattClient.WriteCharacteristic(new CyGattWriteInfo(CharHandle, WriteByte));
MessageBox.Show ("Write Failed: Reason :"+err.ToString());
It's working perfectly, thank you Madhu Sudhan !