简体   繁体   English

在Bluez中编写Gatt Server应用程序

[英]Writing Gatt Server Application in Bluez

We want to write a custom Gatt Server Application for Bluez where we want to give some useful features. 我们想要为Bluez编写一个自定义的Gatt Server应用程序,并在其中提供一些有用的功能。 For example: 例如:

  1. Start Gatt Server 启动Gatt服务器
  2. Register/Unregister custom Service 注册/取消注册自定义服务
  3. Add/Remove custom Characteristics/Descriptor 添加/删除自定义特征/描述符
  4. Set/Get Value of Characteristics/Descriptor 设置/获取特征/描述符的值
  5. Disconnect Client / Close Gatt Server etc. 断开客户端连接/关闭Gatt Server等。

Bluez don't have these features in command line tool but they have several APIs (functions) to do that, we need to call those internal functions. Bluez在命令行工具中没有这些功能,但是它们具有多个API(函数)来执行此操作,我们需要调用这些内部函数。 In according to that we wrote an application in "bluez5.28/attrib/" directory from where we called several internal functions from files of "bluez5.28/attrib/" , "bluez5.28/profiles/" and "bluez5.28/src/" directories and tried to build it with bluez Makefile . 据此,我们在“ bluez5.28 / attrib /”目录中编写了一个应用程序,从中我们从“ bluez5.28 / attrib /”“ bluez5.28 / profiles /”“ bluez5.28 文件中调用了几个内部函数/ src /“目录,并尝试使用bluez Makefile进行构建。

Since bluez have automated generated make file from automake it is quiet hard to make any change in that Makefile. 由于bluez已从automake自动生成了make文件,因此很难对该Makefile进行任何更改。 But when we tried it showed lots of errors regarding dependencies and libraries eg undefined references, no such files of directories, etc. 但是当我们尝试时,它显示出很多有关依赖项和库的错误,例如未定义的引用,没有目录的此类文件等。

Is their any easier way to use bluez functions to make a GattServer Application ? 他们使用bluez函数制作GattServer应用程序的方法是否更简单?

Thanks in advance for your valuable answers..... 在此先感谢您的宝贵答复。

bluez gatt dbus apis are now complete as of version 5.29. 从5.29版开始,bluez gatt dbus api现在已完成。 You may consider using those if going via the dbus rather than directly through library calls is acceptable for you. 如果可以接受通过dbus而不是直接通过库调用,则可以考虑使用它们。

correlate pg:1950 in bluetooth spec4.0 APPENDIX: EXAMPLE ATTRIBUTE SERVER 在蓝牙spec4.0中将pg:1950关联起来附录:示例属性服务器

ATTRIBUTES with gatt-example.c in plugins in bluez5.28 bluez5.28中插件中带有gatt-example.c的属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM