Finally I was able to get rid of the additional features of the BLE extended library. I'm now able to write data to my peripheral and to to register for a notification of a Characteristic and read the value from the Change event. I can post the code if anyone is interested.
However I have a strange behavior when writing data out to the BLE peripheral. Let's start from the code:
Code:
Sub Button3_Click
Log("Message " & x)
manager.WriteCharacteristic(c)
End Sub
Sub ble_CharacteristicWrite (Success As Boolean, Characteristic As BleCharacteristic)
If Success Then
Characteristic.SetStringValue("Message " & x)
x = x + 1
End If
End Sub
When Button3 is pressed the Write method is called and let's say "Message 0" is logged.
The ble_CharacteristicWrite event is immediately fired but I don't get the data immediately at the peripheral.
As Button3 is pressed again I get "Message 1" in the log and finally I also get the old "Message 0" at the peripheral.
In practice it seems like the written data is hold in the app until the next Write is fired.
Am I doing something wrong or what is the intended way to Write data to get it in sync at the peripheral?
Thanks for your suggestions/comments.