Is there any possible way to sedn the data from peripheral device(nrf52832 dev kit) to nrf52840 dongle which is connected to Bluetooth-less desktop

Hello,

In my project, i want to send the data from the ble device nrf52832 dev kit to the nrf52840 dongle which is connected to a Bluetooth-less desktop. Some desktop doesn't have inbuilt Bluetooth and for that, i used an nrf52840 dongle with the help of nrf connect desktop app i flashed the dongle(here i don't have any example or source file, firmware flashed directly by the app), and when I connect it to desktop & scan the peripheral devices with Bluetooth low energy option in nrf connect app. even I can connect the peripheral devices.

Now the issue is how can I send the data from the nrf52832 dev kit to nrf dongle because there is no source file I couldn't add code to receive the data. i tried ble_app_blinky and ble_app_blinky_c examples to send the button state data from peripheral to central so can i use the same for nrf52832 and dongle.??

if so, using the dongle can we connect it to PC and send the data to pc.??

please let me know how can i implement this.

Thank You. 

  • Hello,

    i can able to send the data continuously by doing like this,

    int main(void)
    {
        ret_code_t ret;
        static const app_usbd_config_t usbd_config = {
            .ev_state_proc = usbd_user_ev_handler,
        };
    
        //ret = NRF_LOG_INIT(NULL);
        //APP_ERROR_CHECK(ret);
    
        ret = nrf_drv_clock_init();
        APP_ERROR_CHECK(ret);
    
        //nrf_drv_clock_lfclk_request(NULL);
        //while(!nrf_drv_clock_lfclk_is_running())
        //{
        //    /* Just waiting */
        //}
    
        //ret = app_timer_init();
        //APP_ERROR_CHECK(ret);
    
        //ret = app_timer_create(&m_mouse_move_timer, APP_TIMER_MODE_REPEATED, mouse_move_timer_handler);
        //APP_ERROR_CHECK(ret);
    
        //init_bsp();
    
    //#if NRF_CLI_ENABLED
    //    init_cli();
    //#endif
    
        ret = app_usbd_init(&usbd_config);
        APP_ERROR_CHECK(ret);
    
    //    app_usbd_class_inst_t const * class_inst_mouse;
    //#if CONFIG_HAS_MOUSE
    //    class_inst_mouse = app_usbd_hid_mouse_class_inst_get(&m_app_hid_mouse);
    //#else
    //    class_inst_mouse = app_usbd_dummy_class_inst_get(&m_app_mouse_dummy);
    //#endif
    //    ret = app_usbd_class_append(class_inst_mouse);
    //    APP_ERROR_CHECK(ret);
    
        app_usbd_class_inst_t const * class_inst_kbd;
    #if CONFIG_HAS_KBD
        class_inst_kbd = app_usbd_hid_kbd_class_inst_get(&m_app_hid_kbd);
    #else
        class_inst_kbd = app_usbd_dummy_class_inst_get(&m_app_kbd_dummy);
    #endif
        ret = app_usbd_class_append(class_inst_kbd);
        APP_ERROR_CHECK(ret);
    
        NRF_LOG_INFO("USBD HID composite example started.");
        
        if (USBD_POWER_DETECTION)
        {
            ret = app_usbd_power_events_enable();
            APP_ERROR_CHECK(ret);
        }
        else
        {
            NRF_LOG_INFO("No USB power detection enabled\r\nStarting USB now");
    
            app_usbd_enable();
            app_usbd_start();
        }
    
        while (true)
        {
            counter+=1;
    
            nrf_delay_ms(50);
    
            app_usbd_hid_kbd_key_control(&m_app_hid_kbd, counter, 1);  // Press the key
    
            nrf_delay_ms(50);
    
            app_usbd_hid_kbd_key_control(&m_app_hid_kbd, counter, 0);  // Release the key
    
            nrf_delay_ms(50);
    
            if(counter==39)
            {
            counter=3;
            }
    
            while (app_usbd_event_queue_process())
            {
                /* Nothing to do */
            }
    //#if NRF_CLI_ENABLED
    //        nrf_cli_process(&m_cli_uart);
    //#endif
    
            //UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
            /* Sleep CPU only if there was no interrupt since last loop processing */
            __WFE();
        }
    }
    

    afte this i started to add the code for ble_app_uart_c but  after adding this the first time I got 

    nrf_drv_clock_init() return ERROR 133 [NRF_ERROR_MODULE_ALREADY_INITIALIZED]

     then I commented out nrf_drv_clock_init() because maybe in a soft device its initialized and i checked that with 

    ret = nrf_drv_clock_init_check();
    NRF_LOG_INFO("ret:%d\r\n",ret);

     it returns 1 so it is initialized then after commenting out no errors but I couldn't send the data to Notepad. 

    what will be the problem.?

    Thank You

Related