I am looking to edit and recompile the hcitool.c of bluez version 5.31. I installed the bluez 5.31 by following the procedure from the answer of this: Bluetooth Low Energy in C - using Bluez to create a GATT server
In my trial, I duplicated the hcitool.c file and named it as myhcitool.c inside the tools folder and I use the command
gcc -o myhcitool.o myhcitool.c.
This gives me an error
myhcitool.c:43:27: fatal error: lib/bluetooth.h: No such file or directory
#include "lib/bluetooth.h"
^
compilation terminated.
I tried copying the myhcitool.c outside the tools folder and compile it there. That gave me a bunch of errors something like this:
/tmp/ccj1QmZK.o: In function `dev_info':
myhcitool.c:(.text+0x293): undefined reference to `ba2str'
/tmp/ccj1QmZK.o: In function `conn_list':
myhcitool.c:(.text+0x501): undefined reference to `ba2str'
myhcitool.c:(.text+0x50f): undefined reference to `hci_lmtostr'
myhcitool.c:(.text+0x586): undefined reference to `bt_free'
/tmp/ccj1QmZK.o: In function `cmd_dev':
I also tried editing the hcitool.c itself by modifying a simple printf in there and then redo the 'make' and 'make install' commands for the whole bluez. After that, when I tried running the hcitool, the modification that I did has no effect.