summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-05 11:23:35 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-10-05 11:23:35 +0000
commitf4afe8ea387410929ee303a510fd7cdfd1cc7552 (patch)
tree00cc5a1b55cf2690780d72052903c8f89cdb73e4 /src
parent0d5bcfd73f1d52e3c2b49b28062f9972f40ad42f (diff)
Add support for inquiry transmit power level
Diffstat (limited to 'src')
-rw-r--r--src/hci.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/hci.c b/src/hci.c
index 54e57cf3..8351c475 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -2135,6 +2135,57 @@ int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to)
return 0;
}
+int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to)
+{
+ read_inquiry_transmit_power_level_rp rp;
+ struct hci_request rq;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL;
+ rq.rparam = &rp;
+ rq.rlen = READ_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, to) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ *level = rp.level;
+ return 0;
+}
+
+int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to)
+{
+ write_inquiry_transmit_power_level_cp cp;
+ write_inquiry_transmit_power_level_rp rp;
+ struct hci_request rq;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.level = level;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL;
+ rq.cparam = &cp;
+ rq.clen = WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE;
+ rq.rparam = &rp;
+ rq.rlen = WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, to) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to)
{
read_transmit_power_level_cp cp;