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?

Parents
  • You should not get 0x07 only by increasing the CENTRAL_LINK_COUNT define. This should give a 0x04 NO_MEM error, if you have not changed the RAM settings to make room for the increased softdevice RAM usage. Have you made any other changes to the code?

    This answer shows how to add support for multiple peripherals in the UART central example. It does not provide a complete example, but it is a good starting point to get it up and running.

    Best regards,

    Jørgen

  • 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.

Reply
  • 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.

Children
No Data
Related