is that possible to send the peripheral device data to bluetooth less desktop over ble

Hello,

In my project, I want to send the data from the ble device nrf52832 dev kit to a connected in-built Bluetooth desktop/PC. Some desktop doesn't have inbuilt Bluetooth and for that, so I used a third-party dongle(TP link dongle) that provides Bluetooth capability to Bluetooth-less desktop. I scanned the peripheral devices with a third-party dongle same as the in-built desktop/PC Bluetooth. next, successfully send the data from the peripheral device to the desktop/PC. but i want to develop a custom dongle to send/receive the data from peripherals devices as well as it provides Bluetooth capability to Bluetooth less desktop/PC.

I have tried the nrf52840 dongle and most of them say that it's not recommended for development and even it didn't provide any Bluetooth capability to the desktop as in-built. using nrf connect desktop app we can scan and connect the device but i need the same as the in-built Bluetooth.

So please let me know how can i achieve this.

Thank You. 

Parents Reply Children
  • Hello,

    I tried to add usbd_hid_composite example to ble_app_uart_c example and i got this error,

    <info> app: drv_clock_init:133
    
    <error> app: ERROR 133 [NRF_ERROR_MODULE_ALREADY_INITIALIZED] at C:\NFC_NRF\nRF5_SDK_17.1.0_ddde560\examples\ble_central\ble_app_uart_c - Copy\main.c:862
    PC at: 0x0002E939

    so cross-checked in main.c I didn't find any reinitialization. but in nrf_drv_clock.c of usbd_hid_composite this code is  not visible,

    static void clock_irq_handler(nrfx_clock_evt_type_t evt)
    {
        if (evt == NRFX_CLOCK_EVT_HFCLK_STARTED)
        {
            m_clock_cb.hfclk_on = true;
            clock_clk_started_notify(NRF_DRV_CLOCK_EVT_HFCLK_STARTED);
        }
        if (evt == NRFX_CLOCK_EVT_LFCLK_STARTED)
        {
            m_clock_cb.lfclk_on = true;
            clock_clk_started_notify(NRF_DRV_CLOCK_EVT_LFCLK_STARTED);
        }
    #if CALIBRATION_SUPPORT
        if (evt == NRFX_CLOCK_EVT_CTTO)
        {
            nrf_drv_clock_hfclk_request(&m_clock_cb.cal_hfclk_started_handler_item);
        }
    
        if (evt == NRFX_CLOCK_EVT_CAL_DONE)
        {
            nrf_drv_clock_hfclk_release();
            bool aborted = (m_clock_cb.cal_state == CAL_STATE_ABORT);
            m_clock_cb.cal_state = CAL_STATE_IDLE;
            if (m_clock_cb.cal_done_handler)
            {
                m_clock_cb.cal_done_handler(aborted ?
                    NRF_DRV_CLOCK_EVT_CAL_ABORTED : NRF_DRV_CLOCK_EVT_CAL_DONE);
            }
        }
    #endif // CALIBRATION_SUPPORT
    }
    
    #ifdef SOFTDEVICE_PRESENT
    /**
     * @brief SoftDevice SoC event handler.
     *
     * @param[in] evt_id    SoC event.
     * @param[in] p_context Context.
     */
    static void soc_evt_handler(uint32_t evt_id, void * p_context)
    {
        if (evt_id == NRF_EVT_HFCLKSTARTED)
        {
            m_clock_cb.hfclk_on = true;
            clock_clk_started_notify(NRF_DRV_CLOCK_EVT_HFCLK_STARTED);
        }
    }
    NRF_SDH_SOC_OBSERVER(m_soc_evt_observer, CLOCK_CONFIG_SOC_OBSERVER_PRIO, soc_evt_handler, NULL);
    
    /**
     * @brief SoftDevice enable/disable state handler.
     *
     * @param[in] state     State.
     * @param[in] p_context Context.
     */
    static void sd_state_evt_handler(nrf_sdh_state_evt_t state, void * p_context)
    {
        switch (state)
        {
            case NRF_SDH_EVT_STATE_ENABLE_PREPARE:
                NVIC_DisableIRQ(POWER_CLOCK_IRQn);
                break;
    
            case NRF_SDH_EVT_STATE_ENABLED:
                CRITICAL_REGION_ENTER();
                /* Make sure that nrf_drv_clock module is initialized */
                if (!m_clock_cb.module_initialized)
                {
                    (void)nrf_drv_clock_init();
                }
                /* SD is one of the LFCLK requesters, but it will enable it by itself. */
                ++(m_clock_cb.lfclk_requests);
                m_clock_cb.lfclk_on = true;
                CRITICAL_REGION_EXIT();
                break;
    
            case NRF_SDH_EVT_STATE_DISABLED:
                /* Reinit interrupts */
                ASSERT(m_clock_cb.module_initialized);
                nrfx_clock_enable();
    
                /* SD leaves LFCLK enabled - disable it if it is no longer required. */
                nrf_drv_clock_lfclk_release();
                break;
    
            default:
                break;
        }
    }
    
    NRF_SDH_STATE_OBSERVER(m_sd_state_observer, CLOCK_CONFIG_STATE_OBSERVER_PRIO) =
    {
        .handler   = sd_state_evt_handler,
        .p_context = NULL,
    };
    

    but its visible in ble_app_uart_c example so did I make any mistake here. please let me know.

    Thank You.

  • What function returned the value that is checked in main.c line 862?

    BR,
    Edvin

  • Hello,

    nrf_drv_clock_init(); return this error.

    Thank You.

  • Hello hello..!!.

    That suggests that the clock is already initialized, wouldn't you agree? Try setting a breakpoint inside nrf_drv_clock_init() and see if it is reached before you reach line 862 in main.c. Is it reached? If so, you can just comment out nrf_drv_clock_init() on line 862 in main.c.

    Best regards,

    Edvin

Related