I am having difficulty figuring out how to convert my bluetooth command (from Gatttool) to Bluez c code.
Can you help me translate the following Gatttool command (bluetooth request) to c?
[CON][MY_MAC_ADDRESS][LE]> char-write-req 0x00c0 0100
So my handle is 0x00c0
and my data is 0100
(on). I don't know which hci_request
structure properties I need to fill (except for the handle).
... 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);