summaryrefslogtreecommitdiffstats
path: root/src/hci.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci.c')
-rw-r--r--src/hci.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/hci.c b/src/hci.c
index ca53105e..8e0b7938 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -1432,6 +1432,36 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to)
return 0;
}
+int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to)
+{
+ read_transmit_power_level_cp cp;
+ read_transmit_power_level_rp rp;
+ struct hci_request rq;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.handle = handle;
+ cp.type = type;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_READ_TRANSMIT_POWER_LEVEL;
+ rq.cparam = &cp;
+ rq.clen = READ_TRANSMIT_POWER_LEVEL_CP_SIZE;
+ rq.rparam = &rp;
+ rq.rlen = READ_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_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to)
{
read_link_supervision_timeout_rp rp;