You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/07/11 23:50:35 UTC

[45/50] [abbrv] incubator-mynewt-core git commit: BLE Host - ble_gap_conn_rssi().

BLE Host - ble_gap_conn_rssi().


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/44b45e97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/44b45e97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/44b45e97

Branch: refs/heads/ble_hs_api
Commit: 44b45e97b14cd7b58a7394e96215d204fbb3878a
Parents: 1c8a135
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Jul 8 13:22:42 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Jul 11 16:43:34 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/include/host/ble_gap.h |  1 +
 net/nimble/host/src/ble_gap.c          | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/44b45e97/net/nimble/host/include/host/ble_gap.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_gap.h b/net/nimble/host/include/host/ble_gap.h
index 7577d6d..79868c5 100644
--- a/net/nimble/host/include/host/ble_gap.h
+++ b/net/nimble/host/include/host/ble_gap.h
@@ -457,5 +457,6 @@ int ble_gap_security_initiate(uint16_t conn_handle);
 int ble_gap_pair_initiate(uint16_t conn_handle);
 int ble_gap_encryption_initiate(uint16_t conn_handle, const uint8_t *ltk,
                                 uint16_t ediv, uint64_t rand_val, int auth);
+int ble_gap_conn_rssi(uint16_t conn_handle, int8_t *out_rssi);
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/44b45e97/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index 48285d6..73c9e42 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -2774,6 +2774,32 @@ ble_gap_enc_event(uint16_t conn_handle, int status, int security_restored)
 }
 
 /*****************************************************************************
+ * $rssi                                                                     *
+ *****************************************************************************/
+
+/**
+ * Retrieves the most-recently measured RSSI for the specified connection.  A
+ * connection's RSSI is updated whenever a data channel PDU is received.
+ *
+ * @param conn_handle           Specifies the connection to query.
+ * @param out_rssi              On success, the retrieved RSSI is written here.
+ *
+ * @return                      0 on success;
+ *                              A BLE host HCI return code if the controller
+ *                                  rejected the request;
+ *                              A BLE host core return code on unexpected
+ *                                  error.
+ */
+int
+ble_gap_conn_rssi(uint16_t conn_handle, int8_t *out_rssi)
+{
+    int rc;
+
+    rc = ble_hci_util_read_rssi(conn_handle, out_rssi);
+    return rc;
+}
+
+/*****************************************************************************
  * $notify                                                                   *
  *****************************************************************************/