设为首页 加入收藏

TOP

使用BlueZ进行蓝牙编程时需要注意的问题
2014-11-24 11:36:36 来源: 作者: 【 】 浏览:0
Tags:使用 BlueZ 进行 蓝牙 编程 需要 注意 问题

一:不要用到哪个Bluez头文件中定义的内容就只去包含这个头文件。而应该将bluetooth/bluetooth.h最先加入。类似:


#include //BTPROTO_HCI
#include //struct hci_dev_info
#include //hci_devid()
#include //l2cap
#include //hidp


二:因为Linux 下Bluetooth实现是通过socket来完成的。sa_family_t会被使用。


bluetooth/hci.h中就用到了。所以必须在include bluetooth header file之前,include socket header file.
#include
#include
否则就会出现类似以下问题:
bluetooth/hci.h:1091: error: expected specifier-qualifier-list before 'sa_family_t'


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux下Bluetooth编程 下一篇Emacs C++智能提示

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C语言中,“指针”用 (2025-12-26 15:20:18)
·在c语言的指针运算中 (2025-12-26 15:20:15)
·C语言-函数指针与函 (2025-12-26 15:20:12)
·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)