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

Transmit Large Data 518222

Hi!

I have a Nordic nrf51822-DK. I'm need send large data to the Android phone (10 mb). I'm use sample devzone.nordicsemi.com/.../dealing-large-data-packet-s-through-ble , but speed very low (one minute passed 10 kb).

BLE can transmit at speeds of up to 2Mb (www.nordicsemi.com/.../nRF51822).

How speed up data rate?

Parents
  • Thanks for the reply.

    This is code Ole Morten.

    
    static void heart_rate_meas_send(void)
    {
        static uint32_t cnt = 0;
        uint32_t        err_code;
        uint16_t        heart_rate;
        
        while (true)
        {
            heart_rate = (uint16_t)ble_sensorsim_measure(&m_heart_rate_sim_state, &m_heart_rate_sim_cfg);
    
            cnt++;
            err_code = ble_hrs_heart_rate_measurement_send(&m_hrs, heart_rate);
            if (err_code == BLE_ERROR_NO_TX_BUFFERS ||
                err_code == NRF_ERROR_INVALID_STATE || 
                err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING)
            {
                break;
            }
            else if (err_code != NRF_SUCCESS) 
            {
                APP_ERROR_HANDLER(err_code);
            }
        
            // Disable RR Interval recording every third heart rate measurement.
            // NOTE: An application will normally not do this. It is done here just for testing generation
            //       of messages without RR Interval measurements.
            m_rr_interval_enabled = ((cnt % 3) != 0);
        }
    }
    
    
    
    err_code = ble_hrs_heart_rate_measurement_send(&m_hrs, heart_rate);
    
    

    Here is transmitted one byte. How to transfer all 20? In the parameters of the function - uint8

  • A sd_ble_gatts_hvx() call, which is what ble_hrs_heart_rate_measurement_send() does, will transmit up to the characteristic size. To make it transfer 20 bytes, you should therefore make sure that the characterstic is defined to be 20 bytes when initializing it. To better understand how to create a custom service and characteristics, I'd recommend you to take a look on nAN-36: https://www.nordicsemi.com/eng/content/download/34055/573345/file/nAN-36.zip

Reply Children
No Data
Related