Support multiple subscription for single service with multiple characteristics

Hi,

I am working on project where the peripheral has 2 services, and each has multiple characteristics.

The central needs to subscribe to all the characteristics and when doing so I am seeing error: -120 (Socket already connected)

Below is the device log from the central, as you can see I am reading 2 characteristics COMMAND and INDICATION.

When trying to subscribe to the characteristics, I can subscribe to the first characteristics whereas when subscribing to the second characteristics I am getting the error.

Found CMD CHR: 14
Found IND CHR: 17
bt_gatt_subscribe: 0, ccc_handle: 15
[SUBSCRIBED]
bt_gatt_subscribe: -120, ccc_handle: 18

Let me also add our peripheral service server list here for reference

BT_GATT_SERVICE_DEFINE(dev_svc,
    BT_GATT_PRIMARY_SERVICE(BT_UUID_DEV),
    BT_GATT_CHARACTERISTIC(BT_UUID_CMD,
                           (BT_GATT_CHRC_WRITE | BT_GATT_CHRC_INDICATE),
                           BT_GATT_PERM_WRITE,
                           NULL, callback_write_cmd,
                           NULL),
	BT_GATT_CCC(notif_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
    BT_GATT_CHARACTERISTIC(BT_UUID_IND,
                           (BT_GATT_CHRC_WRITE | BT_GATT_CHRC_INDICATE),
                           BT_GATT_PERM_WRITE,
                           NULL, callback_write_ind,
                           NULL),
	BT_GATT_CCC(notif_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
);

Please let me know if I am doing anything wrong or any config we should add.

I am working on NRF Connect SDK v2.7.0

Board: NRF52840

Parents Reply Children
No Data
Related