Hello and thank you for reading. We are using SDK 2.5.0 and the nrf5340, and would appreciate some help with the HID over Gatt functionality.
Our device implements multiple services, including NUS and HID over GATT. We are now experimenting with having multiple centrals connect to our peripheral.
The idea would be that up to five centrals could be paired, and at least two could be connected and subscribed to NUS at the same time. We dont, however, want more than one device to be subscribed to HID at a time. The difficulty is handling the case where client A is connected and subscribed, but then client B connects and subscribes. Ideally client A would be unsubscribed but the connection not dropped so client A can continue using NUS.
Is this do-able? Ive tried setting CONFIG_BT_HIDS_MAX_CLIENT_COUNT to 1, but I can still connect two devices at once and both have mouse movements. Is there some other config I can set? Or is there a way I can in my firmware unsubscribe a client? Or any other way of achieving this?
I have included the prj.conf I used for testing multiple devices below, in case that helps.
Thanks!
# Increased stack due to settings API usage CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_BAS=y CONFIG_BT_DEVICE_NAME="Test HoG mouse" CONFIG_BT_DEVICE_APPEARANCE=962 CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_GPIO=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_LOG_SNIFFER_INFO=y CONFIG_BT_AUTO_PHY_UPDATE=n CONFIG_BT_USER_PHY_UPDATE=y CONFIG_BT_CTLR_PHY_2M=y # ---------------------------- CONFIG_BT_MAX_PAIRED=5 CONFIG_BT_MAX_CONN=6 CONFIG_BT_HIDS=y CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1 CONFIG_BT_NUS=y CONFIG_BT_NUS_AUTHEN=n