This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 588da0f9b apps/bttester: Remove a leftover/broken implementation
588da0f9b is described below

commit 588da0f9b7f047c0b0ac21f9172b9fbf9ce0f0eb
Author: Magdalena Kasenberg <[email protected]>
AuthorDate: Fri Aug 7 17:45:21 2026 +0200

    apps/bttester: Remove a leftover/broken implementation
    
    It seems that the ccc_handle was intended to store the handle of the
    most recently updated CCC descriptor, however the field was overwritten
    with the descriptor value instead, so the unsubscription was failing.
    Apart from that in the RAP profile test cases there are multiple
    subscriptions and unsubscriptions, so the storing and the checks would
    be an obstacle.
---
 apps/bttester/src/btp_gatt.c    | 20 --------------------
 apps/bttester/src/btp_gatt_cl.c | 18 ------------------
 2 files changed, 38 deletions(-)

diff --git a/apps/bttester/src/btp_gatt.c b/apps/bttester/src/btp_gatt.c
index ef4aba5cf..e118c1eb6 100644
--- a/apps/bttester/src/btp_gatt.c
+++ b/apps/bttester/src/btp_gatt.c
@@ -1054,12 +1054,6 @@ fail:
     return BTP_STATUS_FAILED;
 }
 
-static struct bt_gatt_subscribe_params {
-    uint16_t ccc_handle;
-    uint16_t value;
-    uint16_t value_handle;
-} subscribe_params;
-
 static uint8_t
 read_uuid(const void *cmd, uint16_t cmd_len,
           void *rsp, uint16_t *rsp_len)
@@ -1589,8 +1583,6 @@ enable_subscription(uint16_t conn_handle, uint16_t 
ccc_handle,
         return -EINVAL;
     }
 
-    subscribe_params.ccc_handle = value;
-
     tester_rsp(BTP_SERVICE_ID_GATT, op, BTP_STATUS_SUCCESS);
     return 0;
 }
@@ -1602,18 +1594,11 @@ disable_subscription(uint16_t conn_handle, uint16_t 
ccc_handle)
 
     SYS_LOG_DBG("");
 
-    /* Fail if CCC handle doesn't match */
-    if (ccc_handle != subscribe_params.ccc_handle) {
-        SYS_LOG_ERR("CCC handle doesn't match");
-        return -EINVAL;
-    }
-
     if (ble_gattc_write_no_rsp_flat(conn_handle, ccc_handle,
                                     &value, sizeof(value))) {
         return -EINVAL;
     }
 
-    subscribe_params.ccc_handle = 0;
     return 0;
 }
 
@@ -2130,10 +2115,6 @@ tester_gatt_notify_rx_ev(uint16_t conn_handle, uint16_t 
attr_handle,
 
     SYS_LOG_DBG("");
 
-    if (!subscribe_params.ccc_handle) {
-        goto fail;
-    }
-
     if (ble_gap_conn_find(conn_handle, &conn)) {
         goto fail;
     }
@@ -2173,7 +2154,6 @@ tester_gatt_subscribe_ev(uint16_t conn_handle,
 
     if (cur_notify == 0 && cur_indicate == 0) {
         SYS_LOG_INF("Unsubscribed");
-        memset(&subscribe_params, 0, sizeof(subscribe_params));
         return 0;
     }
 
diff --git a/apps/bttester/src/btp_gatt_cl.c b/apps/bttester/src/btp_gatt_cl.c
index a5732c8ef..df4fc8b55 100644
--- a/apps/bttester/src/btp_gatt_cl.c
+++ b/apps/bttester/src/btp_gatt_cl.c
@@ -66,11 +66,6 @@ static struct {
     uint8_t buf[MAX_BUFFER_SIZE];
     uint16_t cnt;
 } gatt_buf;
-static struct bt_gatt_subscribe_params {
-    uint16_t ccc_handle;
-    uint16_t value;
-    uint16_t value_handle;
-} subscribe_params;
 
 static void *
 gatt_buf_add(const void *data, size_t len)
@@ -1366,8 +1361,6 @@ enable_subscription(uint16_t conn_handle, uint16_t 
ccc_handle,
         return -EINVAL;
     }
 
-    subscribe_params.ccc_handle = value;
-
     return 0;
 }
 
@@ -1382,12 +1375,6 @@ disable_subscription(uint16_t conn_handle, uint16_t 
ccc_handle)
     opcode = (uint32_t) (value == 0x0001 ? BTP_GATTC_CFG_NOTIFY_RP
                                          : BTP_GATTC_CFG_INDICATE_RP);
 
-    /* Fail if CCC handle doesn't match */
-    if (ccc_handle != subscribe_params.ccc_handle) {
-        SYS_LOG_ERR("CCC handle doesn't match");
-        return -EINVAL;
-    }
-
     if (ble_gattc_write_flat(conn_handle,
                              ccc_handle,
                              &value,
@@ -1397,7 +1384,6 @@ disable_subscription(uint16_t conn_handle, uint16_t 
ccc_handle)
         return -EINVAL;
     }
 
-    subscribe_params.ccc_handle = 0;
     return 0;
 }
 
@@ -1577,10 +1563,6 @@ tester_gattc_notify_rx_ev(uint16_t conn_handle, uint16_t 
attr_handle,
 
     SYS_LOG_DBG("");
 
-    if (!subscribe_params.ccc_handle) {
-        goto fail;
-    }
-
     if (ble_gap_conn_find(conn_handle, &conn)) {
         goto fail;
     }

Reply via email to