製作了乙個基於bluez的,類似於btw的庫---btx.在編寫和使用這個庫時,發現標頭檔案包含容易出現的問題。
第一:不要用到哪個bluez標頭檔案中定義的內容就只去包含這個標頭檔案。而應該將bluetooth/bluetooth.h最先加入。類似:
//******************************====
//bluetooth header file
#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'
使用blueZ進行藍芽程式設計時需要注意的問題
一 不要用到哪個bluez標頭檔案中定義的內容就只去包含這個標頭檔案。而應該將bluetooth bluetooth.h最先加入。類似 include btproto hci include struct hci dev info include hci devid include l2cap in...
使用blueZ進行藍芽程式設計時需要注意的問題
一 不要用到哪個bluez標頭檔案中定義的內容就只去包含這個標頭檔案。而應該將bluetooth bluetooth.h最先加入。類似 include btproto hci include struct hci dev info include hci devid include l2cap in...
windows phone發布時其他注意事項
對於windows phone人員,發布新應用到微軟商店上時,不但要避免應用本身的bug,還要注意windows phone的其他的一些問題,防止你的應用被 打回 1 主題 theme windows phone的主題包括背影 background 和強調色 accent color 背景有兩種 深...