Bluetooth peripheral receive from a write characteristic
-
I have started to add support into my Linux platform app to act as a BLE peripheral. It advertises OK and clients connect and I've even added some support for device information such as software version, serial number etc.
I have a custom service that will simulate a serial port and has two characteristics, one for RX and another for TX. I can't see how to receive data into my app when the remote client writes to the TX characteristic?
There are signals emitted from QLowEnergyService but these are all from when the controller is in central role, not peripheral? It feels like QLowEnergyService::characteristicWritten() would have been the obvious choice but this is fired when in central role when you have changed a char on a remote (peripheral) device, and I want something the other way around.
QLowEnergyCharacteristic doesn't emit any signals, so it's not there either and QLowEnergyController doesn't have anything useful there either.
There is a heartrate server sample application for using Bluetooth in peripheral mode but it only has a characteristic that is used in 'notify' mode, not one that is written from the remote client.
-
Ignore that, I should've gone back and re-read the documentation...
characteristicChanged() is the QLowEnergyService signal that you want for this.
-