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

multilink [ble_app_uart] - [ble_app_multilink_central]

nRF5_SDK_15.0.0_a53641a,ble_app_uart

When linking [ble_app_uart] and [ble_app_multilink_central], please tell me which settings and functions are missing in the sample program.
Also, when linking [ble_app_uart] and [ble_app_multilink_central], please tell me the method of [ble_app_uart] device discrimination.
Thanking you in advance.
Parents Reply Children
  • [Creating system]
    The AD conversion is performed by four peripheral devices, and AD data of 400 bytes are transmitted to each of the central machines every 100 ms.
    [Current creation status]
    With reference to [ble_app_uart] + [saadc] and [ble_app_uart_c], AD conversion is performed by one peripheral device, and AD data of 400 bytes is transmitted every 100 ms to one central device. It is done up to.
    [Doubt]
    I am trying to make it possible to communicate with four peripherals by comparing [ble_app_uart_c] and [ble_app_multilink_central], but since I can not understand the difference, I can not refer to it.

  • I think you are trying to figure out how to differentiate data that came from different peripherals. For this you have a connection handle that you get when the device gets connected. You can always use this connection handle to map to different connections with your device.

    in our examples you can see this in the below format

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
    
        switch (p_ble_evt->header.evt_id)
        {
            case BLE_GAP_EVT_CONNECTED:
                NRF_LOG_INFO("Connected.");
                conn_handle[i] = p_ble_evt->evt.gap_evt.conn_handle;

  • 1) In [ble_app_uart_c], if you change the setting of sdk_config.h, can you connect with 4 [ble_app_uart] at the same time?
    2) When 4 units of [ble_app_uart] and 1 unit of [ble_app_uart_c] are connected at the same time, will BLE_GAP_EVT_CONNECTED occur on [ble_app_uart_c] side every time communication occurs?
    3) Is it possible to distinguish the equipment by DEVICE_NAME?

  • 1) You need to do some more changes in the main file before enabling the softdevice. The most obvious one is to change your app RAM start as the number of connections affect the softdevice usage of RAM.

    2) yes, you will get BLE_GAP_EVT_CONNECTED four times if you get connected with four different devices. Each will have a different connection handle.

    3) You can do that as this info can be broadcasted in the advertisement/scan response data. After connection you only know peer device address which is another thing you can use to distinguish different peers.

  • An error occurred in the start setting of the application RAM.
    Error "0x04" is occurring at the following location Please tell me how to improve.

    static void ble_stack_init(void)
    {
    ret_code_t err_code;

    /*-< requesting to enable the SoftDevice. >-*/
    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    /*-< Configure the BLE stack using the default settings. >-*/
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
    APP_ERROR_CHECK(err_code);

    /*-< Retrieving the address of the start of application's RAM. >-*/
    err_code = nrf_sdh_ble_app_ram_start_get(&ram_start);
    APP_ERROR_CHECK(err_code);

    /*-< Enable BLE stack.>-*/
    err_code = nrf_sdh_ble_enable(&ram_start);
    APP_ERROR_CHECK(err_code); <--------------------------(err_code = 0x04 error)

    /* Register a handler for BLE events. */
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
    }

    That's all, thank you.
    [Add a question]
    Please tell me how to determine the setting value of IRAM 1.
     
Related