This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dealing large data packet's through ble

Hi, I need to send(using BLE) large amount of data's, which are collected by the accelerometer sensor for 1 hour. I have an external NOR flash where the accelerometer data's are stored and from there data's are transmitted to the BLE stack when sync occurs. I am using nRF51822 nordic controller. Assume that, data size will be 50KB.

Regards, Balaji

Parents
  • Hi Ole and KPE,

    Thanks for the replies. Ole, I might submit a ticket on this today if I can't figure it out by the end of it. KPE, I've tried putting back the packet if I get returned to me, without success. Please see the code below.

    Thanks! Jamie

    static void heart_rate_meas_timeout_handler(void * p_context) //static void heart_rate_meas_send(void) { uint32_t err_code; uint32_t packets = 0; static uint16_t heart_rate=0x0018;

    //UNUSED_PARAMETER(p_context);
    
    static uint16_t x=0,y=0,z=0;
    
    //while(TxBuffersAvailable)
    while(TxBuffersAvailable && packets < 6)
    {		
    	if(ble_hrs_rr_interval_buffer_is_empty(&m_hrs))
    	{
    		for(int i=0;i<3;++i)
    		{			
    			/*
    			if(x<=50)
    			{
    				x++;y++;z++;
    			}
    			else
    			{
    				x=0;y=0;z=0;
    			}*/
    			ble_hrs_rr_interval_add(&m_hrs, x++);
    			ble_hrs_rr_interval_add(&m_hrs, y++);
    			ble_hrs_rr_interval_add(&m_hrs, z++);
    		}
    		
    		packets++;
    		
    		err_code = ble_hrs_heart_rate_measurement_send(&m_hrs, heart_rate, 0);
    		if (err_code == NRF_ERROR_INVALID_STATE ||
    				err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING)
    		{								
    			break;
    		}
    		else if (err_code == BLE_ERROR_NO_TX_BUFFERS)
    		{			
    			//x--;y--;z--;
    			nrf_gpio_pin_toggle(LED_PIN);
    			TxBuffersAvailable=false;				
    			break;				
    		}
    		else if (err_code != NRF_SUCCESS) 
    		{
    			APP_ERROR_HANDLER(err_code);
    		}
    	}
    	else break;
    }
    
Reply
  • Hi Ole and KPE,

    Thanks for the replies. Ole, I might submit a ticket on this today if I can't figure it out by the end of it. KPE, I've tried putting back the packet if I get returned to me, without success. Please see the code below.

    Thanks! Jamie

    static void heart_rate_meas_timeout_handler(void * p_context) //static void heart_rate_meas_send(void) { uint32_t err_code; uint32_t packets = 0; static uint16_t heart_rate=0x0018;

    //UNUSED_PARAMETER(p_context);
    
    static uint16_t x=0,y=0,z=0;
    
    //while(TxBuffersAvailable)
    while(TxBuffersAvailable && packets < 6)
    {		
    	if(ble_hrs_rr_interval_buffer_is_empty(&m_hrs))
    	{
    		for(int i=0;i<3;++i)
    		{			
    			/*
    			if(x<=50)
    			{
    				x++;y++;z++;
    			}
    			else
    			{
    				x=0;y=0;z=0;
    			}*/
    			ble_hrs_rr_interval_add(&m_hrs, x++);
    			ble_hrs_rr_interval_add(&m_hrs, y++);
    			ble_hrs_rr_interval_add(&m_hrs, z++);
    		}
    		
    		packets++;
    		
    		err_code = ble_hrs_heart_rate_measurement_send(&m_hrs, heart_rate, 0);
    		if (err_code == NRF_ERROR_INVALID_STATE ||
    				err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING)
    		{								
    			break;
    		}
    		else if (err_code == BLE_ERROR_NO_TX_BUFFERS)
    		{			
    			//x--;y--;z--;
    			nrf_gpio_pin_toggle(LED_PIN);
    			TxBuffersAvailable=false;				
    			break;				
    		}
    		else if (err_code != NRF_SUCCESS) 
    		{
    			APP_ERROR_HANDLER(err_code);
    		}
    	}
    	else break;
    }
    
Children
No Data
Related