summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Crane <steve.crane@rococosoft.com>2002-08-21 16:38:15 +0000
committerStephen Crane <steve.crane@rococosoft.com>2002-08-21 16:38:15 +0000
commit803bf105508009f7efc87276a539dda244527690 (patch)
tree6a2dfa70768b0d06bdb52461e59c0823ad160c15 /src
parent63a52518621efce1ec40afb05b8b698e4d6b9b2f (diff)
implement hci_{read, write}_current_iac_lap()
Diffstat (limited to 'src')
-rw-r--r--src/hci.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/hci.c b/src/hci.c
index 1424ddcd..40a19fb2 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -923,3 +923,42 @@ int hci_class_of_dev(int dd, uint8_t *class, int to)
return 0;
}
+int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to)
+{
+ read_current_iac_lap_rp rp;
+ struct hci_request rq;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_READ_CURRENT_IAC_LAP;
+ rq.rparam = &rp;
+ rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE;
+ if (0 > hci_send_req(dd, &rq, to))
+ return -1;
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+ *num_iac = rp.num_current_iac;
+ memcpy(lap, rp.lap, 3*rp.num_current_iac);
+ return 0;
+}
+
+int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to)
+{
+ write_current_iac_lap_cp cp;
+ struct hci_request rq;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.num_current_iac = num_iac;
+ memcpy(&cp.lap, lap, 3*num_iac);
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_WRITE_CURRENT_IAC_LAP;
+ rq.cparam = &cp;
+ rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE;
+ if (0 > hci_send_req(dd, &rq, to))
+ return -1;
+ return 0;
+}