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

nRF UART service with multiple peripherals

I want to have an application similar to UART in the SDK example, with multiple peripherals.

I tried to modified existing UART example, but cannot make the central node to support multiple peripherals because softdevice_enable() only accepts 1 central link count. It returns run time error if central link count > 1.

My questions are:

(1) is it possible just to modify UART code to achieve my goal?

If not, can I combine UART and multiple link examples?

Is there a better way?

  • my code have DLE feature:

    	//Configure the memory pools available for application packets
    	ble_conn_bw_counts_t conn_bw_counts = {
    			.tx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0},
    			.rx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0}
    	};
    		
    	//Configure conn_bw_counts in enable_params (along with others) 
    	ble_enable_params.common_enable_params.p_conn_bw_counts = &conn_bw_counts;
    	ble_enable_params.common_enable_params.vs_uuid_count = 1;
    	ble_enable_params.gatts_enable_params.attr_tab_size = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
    	ble_enable_params.gatts_enable_params.service_changed = 0;
    	ble_enable_params.gap_enable_params.periph_conn_count = PERIPHERAL_LINK_COUNT; //PERIPHERAL_LINK_COUNT   0   < Number of peripheral links used by the application. When changing this number remember to adjust the RAM settings
    	ble_enable_params.gap_enable_params.central_conn_count = CENTRAL_LINK_COUNT; //CENTRAL_LINK_COUNT      1  < Number of central links used by the application. When changing this number remember to adjust the RAM settings
    	ble_enable_params.gap_enable_params.central_sec_count = 1;
    

    I will try to modify the original UART code and see what happens. Thx.

  • By following the post link text, I have made it partially work.

    Now the central node can have two connections to peripheral nodes and even able to receive from the two P nodes.

Related