You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "piotrnarajowski (via GitHub)" <gi...@apache.org> on 2026/07/15 14:57:35 UTC

Re: [PR] nimble/host: Rework ble_gatts_notify_multiple_custom [mynewt-nimble]

piotrnarajowski commented on code in PR #2229:
URL: https://github.com/apache/mynewt-nimble/pull/2229#discussion_r3588347223


##########
nimble/host/src/ble_gattc.c:
##########
@@ -4424,85 +4424,78 @@ ble_gatts_notify_multiple_custom(uint16_t conn_handle,
 #endif
 
     int rc;
-    size_t i = 0;
-    uint16_t cur_chr_cnt = 0;
-    /* mtu = MTU - 1 octet (OP code) */
-    uint16_t mtu = ble_att_mtu(conn_handle) - 1;
+    size_t i;
     struct os_mbuf *txom;
-    struct ble_hs_conn *conn;
+    uint16_t le16;
+    uint8_t supported;
+    uint16_t total = 1; /* opcode */
 
-    txom = ble_hs_mbuf_att_pkt();
-    if (txom == NULL) {
-        return BLE_HS_ENOMEM;
+    /* validate handles sanity */
+    for (i = 0; i < chr_count; i++) {
+        if (tuples->handle == 0) {
+            rc = BLE_HS_EINVAL;
+            goto err;
+        }
     }
 
-    conn = ble_hs_conn_find(conn_handle);
-    if (conn == NULL) {
-        return BLE_HS_ENOTCONN;
+    if (chr_count < 2) {
+        rc = BLE_HS_EINVAL;
+        goto err;
+    }
+
+    rc = ble_gatts_peer_cl_sup_feat_get(conn_handle, &supported, sizeof(supported));
+    if (rc) {
+        goto err;
+    }
+
+    if ((supported & 0x04) == 0) {

Review Comment:
   @KKopyscinski did you mean something like this?
   https://github.com/apache/mynewt-nimble/pull/2114/changes#diff-8f295345b2f6ddf7818b54784a71b332781fc6a9452ed864ceadb45a3973f6bcR38



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

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