Part Number: LAUNCHXL-CC2650
Tool/software: Code Composer Studio
Hello,
I am trying to develope a software, that can read and write data from and to a characteristic. The sending part seems to be working more or less good. The problem is receiving the data. Iam developing based on the SimpleBLEperipheral Example. I have 2 questions:
1. Notification: The characteristic I am trying to read has notifications enabled and I want to have a callback function, that gets called, whenever the value changes. After some reading into the issue I found the static void SimpleBLEPeripheral_charValueChangeCB(uint8_t paramID) function. After some test I found, that the function never gets called, when the char value changes. What am I doing wrong?
2. Writing: I am writing the characteristic value, central side, from a Win10 platform via WinRT. The code for writing is:
public async void Write()
{
byte[] startCommand = new byte[] { 0x44, 0x45, 0x56, 0x3F, 0x5F, 0x58, 0x32, 0x45, 0x44, 0x34, 0x0D };
GattCharacteristic gattCharacteristic = Outbuf;
var writer = new DataWriter();
writer.WriteBytes(startCommand);
var res = await gattCharacteristic.WriteValueAsync(writer.DetachBuffer(), GattWriteOption.WriteWithoutResponse);
return;
}
The problem is: After writing I can see the written value in the characteristic, but when I read again the previous value, that was in the characteristic value before, is shown again. If the written data is the first, then the characteristic value is all Zeros after reading.