You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by "Roshan23699 (via GitHub)" <gi...@apache.org> on 2023/12/12 09:11:18 UTC

[PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Roshan23699 opened a new pull request, #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661

   1. Fix read on client-supported features. 
   2. Read cannot return the local client-supported features, it should return the client-supported features for the reading connection. (This change is needed for PTS). 


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on code in PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#discussion_r1432679893


##########
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:
   I'm fine with either,   if buffer is smaller we can fill just up to its size and ignore rest,  currently only 3 bits are defined so it will be 1 for some time anyway



-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "Roshan23699 (via GitHub)" <gi...@apache.org>.
Roshan23699 commented on PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#issuecomment-1855109363

   @sjanc could you PTAL ?


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "KKopyscinski (via GitHub)" <gi...@apache.org>.
KKopyscinski commented on code in PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#discussion_r1432667638


##########
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:
   > this should copy no more than N bytes of mentioned length parameter
   
   and maybe N should be checked as `N < BLE_GATT_CHR_CLI_SUP_FEAT_SZ`?



-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on code in PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#discussion_r1432661663


##########
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:
   please name it  ble_gatts_peer_cl_sup_feat_get(),  also there should be len parameter for how many bytes are available in out_supported_feat array



##########
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:
   this should copy no more than N bytes of mentioned length parameter



-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "Roshan23699 (via GitHub)" <gi...@apache.org>.
Roshan23699 commented on PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#issuecomment-1855583906

   **GATT/SR/GAS/BV-04-C**
   Maintaining Client-Supported Features Characteristic Values for Bonded Devices. 
   
   


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "Roshan23699 (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661#issuecomment-1855317885

   Hi,
   
   which test was affected by this?


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] nimble/gatts: Modify client supported features READ [mynewt-nimble]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc merged PR #1661:
URL: https://github.com/apache/mynewt-nimble/pull/1661


-- 
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: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org