【发布时间】:2016-07-23 03:30:42
【问题描述】:
我很难弄清楚如何将我的蓝牙命令(来自 Gatttool)转换为 Bluez c 代码。
你能帮我把下面的 Gatttool 命令(蓝牙请求)翻译成 c 吗?
[CON][MY_MAC_ADDRESS][LE]> char-write-req 0x00c0 0100
所以我的句柄是0x00c0,我的数据是0100(开启)。我不知道我需要填写哪些hci_request 结构属性(句柄除外)。
... I've successfully connected to the device (LE connection)
struct hci_request rq = {0};
rq.ogf = ??; // should the handle go here?
rq.ocf = ??; // should the data go here
rq.cparam = ??;
rq.clen = ??;
rq.rparam = ??;
rq.rlen = ??;
rq.event = ??; // what would the event be?
hci_send_req(dd, &rq, 1000);
【问题讨论】: