I guess we really need a BLE server now.
Let's say you have an embedded device that has a few environmental sensors attached, such as humidity and temperature. You need to send this data over Bluetooth to another handheld device once in a while. On the embedded sensor device, you need to setup the device. The basic procedure to set up the BLE server is as follows:
- Supply advertisement data (
QLowEnergyAdvertisingData
) - Supply characteristic data (
QLowEnergyCharacteristicData
) - Set up the service data (
QLowEnergyServiceData
) - Start advertising and listening for connections
QLowEnergyAdvertisingData
is the class you use to tell the server what and how the data is going to be presented.
Here's how we would use QLowEnergyAdvertisingData.
Construct a QLowEnergyAdvertisingData
object:
QLowEnergyAdvertisingData *leAdd = new QLowEnergyAdvertisingData;
Set Discoverability
options:
leAdd->setDiscoverability( QLowEnergyAdvertisingData::DiscoverabilityGeneral...