This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Enable multipe slaves in NCS nrf_desktop keyboard

Hi   guys,

              I want to add the function of multiple slaves to the nrf_desktop routine to support two hosts to connect to the keyboard.This routine is in the ncs1.4.1\v1.4.1\nrf\applications\nrf_desktop directory.  So I added a macro definition ( CONFIG_BT_MAX_CONN 2)      in  app_ZDebug.conf file.

         But  I  encoutered the following compilation problem:
              1.
BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) ||
		     (ARRAY_SIZE(active_conn) == 1));
    in   ble_state.c  line 398.
         After I  blocked the code,my keyboard supports simultaneous connection of two devices.but I  encoutered  a new problem which occurred when the second device was bound. The error log is  as follows:
                2.
[01779879] <inf> ble_state: Connected to 48:01:c5:21:6c:9a (public)
[01779887] <inf> event_manager: e: ble_peer_event id=0x20002e38 CONNECTED 
[01779888] <wrn> bt_conn_ctx: Memory can not be allocated                        
[01779889] <wrn> bt_hids: There is no free memory to allocate the connection context  
[01779889] <err> hids: Failed to notify the HID Service about the connection           

ASSERTION FAIL [cur_conn == ((void *)0)] @ ../src/modules/hids.c:473 
      
     I  try to modify the heap size (CONFIG_HEAP_MEM_POOL_SIZEin  app_ZDebug.conf file.but still can not solve the problem.
   How to bind the keyboard to  two host devices at the same time?
           
 
          
           
清除原文

 

 

Related