Resuming from last article , I modify the bluez code to be a simple peripheral (GATT server).
download the last bluez .
use the parameters to configurate it.
If you encounter some error like that :
just install those libraries. I note here, in fedora, the libudev has been included in systemd package, you should use that command line:
To install libudev-dev.
After configuration has been done, the building should be passed without error.
Stop current bluetoothd program:
In fedora :
In Ubuntu :
Then, goto the src folder under your bluez package, and execute that:
If the output log be :
That is, the gatt-server fails in start. The only solution I know currently, is to use the Bluez version which is not later than 5.28. please back to Step 0, use version 5.28 and do all again.
if your result be :
Congratulation, you could go below.
Excute the command :
And run this script, bleAdvertise:
You should be able to use your mobile application (BLE scanner for Android, LightBlue for iOS)
to scan and connect to this Bluez peripheral.
That shows the bluez gatt-server works.
Backup the plugin/wiimote.c , and replace that as below code completely:
And re-compiler the bluez library (you could just delete plugins/bluetoothd-wiimote.o and
type make again to boost the compilation time).
Similar with Step 3
Execute the command line under src folder:
And run the BleAdvertise script again : you may need to run it twice, to ensure that has been executed indeedly.
Now you could use your BLE Scanner or LightBlue to confirm your Pheripheral has been run:
Known Insuffiecient :
If a central device (moblie) access the Notify characteristic, the bluez peripheral would be led to crash.
After the disconneciton event occurs, the Bluez perihpheral would not start again, it is,you need to run the BleAdvertise script again.