Roshan23699 commented on code in PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#discussion_r1434777292


##########
nimble/host/include/host/ble_gatt.h:
##########
@@ -1096,6 +1096,25 @@ int ble_gatts_start(void);
 int ble_gatts_peer_cl_sup_feat_update(uint16_t conn_handle,
                                       struct os_mbuf *om);
 
+/**
+ * Gets Client Supported Features for specified connection.
+ *
+ * @param conn_handle           Connection handle identifying connection for
+ *                              which Client Supported Features should be saved
+ * @param out_supported_feat    Client supported features to be returned.
+ *
+ * @return                      0 on success;
+ *                              BLE_HS_ENOTCONN if no matching connection
+ *                              was found
+ *                              BLE_HS_EINVAL if supplied buffer is empty or
+ *                              if any Client Supported Feature was
+ *                              attempted to be disabled.
+ *                              A BLE host core return code on unexpected
+ *                              error.
+ *
+ */
+int ble_gatts_get_peer_cl_sup_feat(uint16_t conn_handle, uint8_t 
*out_supported_feat);

Review Comment:
   Done. 



##########
nimble/host/src/ble_gatts.c:
##########
@@ -1580,6 +1580,31 @@ ble_gatts_chr_updated(uint16_t chr_val_handle)
     }
 }
 
+int
+ble_gatts_get_peer_cl_sup_feat(uint16_t conn_handle, uint8_t 
*out_supported_feat)
+{
+    struct ble_hs_conn *conn;
+    int rc = 0;
+
+    if (out_supported_feat == NULL) {
+        return BLE_HS_EINVAL;
+    }
+
+    ble_hs_lock();
+    conn = ble_hs_conn_find(conn_handle);
+    if (conn == NULL) {
+        rc = BLE_HS_ENOTCONN;
+        goto done;
+    }
+
+    memcpy(out_supported_feat, conn->bhc_gatt_svr.peer_cl_sup_feat,

Review Comment:
   Done. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to