Community
cancel
Showing results for 
Search instead for 
Did you mean: 
MPenz1
New Contributor II
2,651 Views

GATT Server

I need to create a GATT Server on intel Edison. Actually i'm programm with C++.

Are there news about GATT utilities to create GATT server from code?

Thanks

0 Kudos
8 Replies
idata
Community Manager
146 Views

Hello Ruscoff,

 

 

First you will have to install a version of BlueZ that includes gatttool. After that, you could use libgatt ( https://github.com/jacklund/libgatt) it is BlueZ's GATT/LE code extracted into a library.

 

 

I hope this helps.

 

-Peter.
MPenz1
New Contributor II
146 Views

Hi,

actually in my Edion there is installed BlueZ 5.28 that should has got gatttool.

So, to use that libgatt in eclipse i have to compile libgatt with edison, and after put include on eclipse and replace linker old libbluetooth with compiled new libgatt lib, is it right?

Edit:

By the way, i briefly list file into liigatt and seems that it is only for client gatt. Miss all file like gatt-service.h attrib-server.h and other need to register and manage GATT database.

Maybe bluez 5.7 can't handle GATT server. Pheraphs needed librarys was adder in newer version.

idata
Community Manager
146 Views

In order to use an additional library you will not only need to install it on Edison but also add it to Eclipse. I'd suggest you to read the following documents: http://help.eclipse.org/mars/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_...

 

https://www.eclipse.org/forums/index.php/t/238028/

 

 

If libgatt does not work for you, then you will probably have to use BlueZ's API itself. You can find it's source code in http://git.kernel.org/cgit/bluetooth/bluez.git

 

 

-Peter.
MPenz1
New Contributor II
146 Views

Hi Peter,

I just tryed to compile blueZ, it ends correctly, but i couldn't found generated .so file to link in eclipse. Seems bluez not create library but only executable file.

Also try with --enable-library directive but i couldn't found.

MPenz1
New Contributor II
146 Views

For who followed this thread and has same problem i have resolved in this way:

1) download bluez 5.28 on edison

2) modify wiimote.c in plugins/ subdirectory with my gatt server definition and action. Actually i decided to exchange informations with my program through virtual files.

3) compile it and execute ./bluetoothd -p wiimote

 

4) on my c++ programm i poll and synchronize on these file

5) use socket on HCI flow to catch event of connection and disconnection of user to restart advertisment message and other stuff.

Maybe in future someone of good will make a c++ library to simplify this hell on earth.

idata
Community Manager
146 Views

Try using the steps found in these thread: https://communities.intel.com/message/363161# 363161 https://communities.intel.com/message/363161# 363161

 

 

Let me know if they help.

 

 

Also, I found the following document online and I thought you might find it helpful:

 

 

https://eclipse.github.io/kura/doc/bluetooth-le-example.html

 

 

-Peter.
MPenz1
New Contributor II
146 Views

Hi Peter,

real problem of blueZ is that not release GATT server methods on its library, this is real reason because someone had created libgatt

In the same way gatttool is useful only to connect to GATT server but not to create it.

In my opinion there are something more deep because there aren't exist GATT server libraries. Maybe GATT server could be defined only at startup of bluetoothd service and Noble library use HCI socket bus to emulate response of main service.

Marco

idata
Community Manager
146 Views

I believe you should contact BlueZ ( http://www.bluez.org/contact/) for more help as the issue seems to be directly related to their libraries. They might be able to tell you what the best way to access the GATT API is.

 

 

-Peter.
Reply