You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/02/11 02:36:49 UTC
incubator-mynewt-larva git commit: Host HCI command to read RSSI
Repository: incubator-mynewt-larva
Updated Branches:
refs/heads/master 3e88a5c6c -> 545579000
Host HCI command to read RSSI
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/54557900
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/54557900
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/54557900
Branch: refs/heads/master
Commit: 545579000c84cf2c7caf4d57e0d33110ea0bad4a
Parents: 3e88a5c
Author: wes3 <wi...@micosa.io>
Authored: Wed Feb 10 17:36:30 2016 -0800
Committer: wes3 <wi...@micosa.io>
Committed: Wed Feb 10 17:36:43 2016 -0800
----------------------------------------------------------------------
net/nimble/host/include/host/host_hci.h | 1 +
net/nimble/host/src/host_hci_cmd.c | 20 ++++++++++++++++++++
net/nimble/include/nimble/hci_common.h | 3 +++
3 files changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/54557900/net/nimble/host/include/host/host_hci.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/host_hci.h b/net/nimble/host/include/host/host_hci.h
index 8d92b4c..4dc16a9 100644
--- a/net/nimble/host/include/host/host_hci.h
+++ b/net/nimble/host/include/host/host_hci.h
@@ -31,6 +31,7 @@ int host_hci_cmd_set_event_mask(uint64_t event_mask);
int host_hci_cmd_disconnect(uint16_t handle, uint8_t reason);
int host_hci_cmd_rd_rem_version(uint16_t handle);
int host_hci_cmd_rd_local_version(void);
+int host_hci_cmd_read_rssi(uint16_t handle);
int host_hci_cmd_le_set_scan_rsp_data(uint8_t *data, uint8_t len);
int host_hci_cmd_le_set_adv_data(uint8_t *data, uint8_t len);
int host_hci_cmd_le_set_adv_params(struct hci_adv_params *adv);
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/54557900/net/nimble/host/src/host_hci_cmd.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/host_hci_cmd.c b/net/nimble/host/src/host_hci_cmd.c
index 9946f04..42b5af8 100644
--- a/net/nimble/host/src/host_hci_cmd.c
+++ b/net/nimble/host/src/host_hci_cmd.c
@@ -633,3 +633,23 @@ host_hci_cmd_le_conn_param_neg_reply(struct hci_conn_param_neg_reply *hcn)
return rc;
}
+/**
+ * Read the RSSI for a given connection handle
+ *
+ * NOTE: OGF=0x05 OCF=0x0005
+ *
+ * @param handle
+ *
+ * @return int
+ */
+int
+host_hci_cmd_read_rssi(uint16_t handle)
+{
+ int rc;
+ uint8_t cmd[sizeof(uint16_t)];
+
+ htole16(cmd, handle);
+ rc = host_hci_cmd_send(BLE_HCI_OGF_STATUS_PARAMS, BLE_HCI_OCF_RD_RSSI,
+ sizeof(uint16_t), cmd);
+ return rc;
+}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/54557900/net/nimble/include/nimble/hci_common.h
----------------------------------------------------------------------
diff --git a/net/nimble/include/nimble/hci_common.h b/net/nimble/include/nimble/hci_common.h
index 52056b2..b2d476b 100644
--- a/net/nimble/include/nimble/hci_common.h
+++ b/net/nimble/include/nimble/hci_common.h
@@ -94,6 +94,9 @@
#define BLE_LMP_VER_BCS_4_1 (7)
#define BLE_LMP_VER_BCS_4_2 (8)
+/* List of OCD for Status parameters commands (OGF = 0x05) */
+#define BLE_HCI_OCF_RD_RSSI (0x0005)
+
/* List of OCF for LE commands (OGF = 0x08) */
#define BLE_HCI_OCF_LE_SET_EVENT_MASK (0x0001)
#define BLE_HCI_OCF_LE_RD_BUF_SIZE (0x0002)