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

throughput manage (BLE_ERROR_NO_TX_PACKETS)

Hello,

First of all I know that many questions were posted here about this topic but I am posting mine because I couldn't figure out how to solve my issue and I am looking for new ideas.

I am working on a project of throughput data from sensors to my central via nRF51822 through a notifying service (SDK12.2, S130).

My central is an iOS app, and my throughput data are given from STM32 via UART but am sure I get them correctly. Also am using a simple buffer not fifo.

            MIN_CONN_INTERVAL               MSEC_TO_UNITS(20, UNIT_1_25_MS)  
            MAX_CONN_INTERVAL               MSEC_TO_UNITS(40, UNIT_1_25_MS) 
            SLAVE_LATENCY                   3   

first of all I was adding packets to the TX buffer, faster than they can be sent out, and I got "BLE_ERROR_NO_TX_PACKETS " error. so I tried to make sure that my TX task is complete before initiating next one with this implementation:

  do{  
          err_code = ble_data_send(&m_data_send, data_packet);
           nrf_delay_ms(2);
    }while(err_code== BLE_ERROR_NO_TX_PACKETS);

But I still have the same problem.

What am I missing?

Is there any problem with my implementation?

Is there any example of maximum throughput manage?

Can this be a cause of my central ?

thank you in advance devzone community. PS: if you want I can give more details.

Parents
  • 1/ I still dont understand your question: the numerical value of the throughput you are getting?

    2/ I am sorry but I cant add the complete project so I will show more about the implementation

    3/ ok

    4/ Now the throughput is going well, what I did is that I created a new instance of FIFO to get and send data through my service so I guess I was asking my FIFO for too much work. About the way to handle this, my implementation would be something like:

    	err_code = ble_data_send(&m_data_send, data_packet);
    	if (err_code == BLE_ERROR_NO_TX_PACKETS) 
           {
    			while(my_flag != true)
    			     {
    					//do nothing
    				 }
            
            err_code = ble_data_send(&m_data_send, data_packet);
    		my_flag = false;
           }
    

    and in the ble_evt_handle:

    		case BLE_EVT_TX_COMPLETE:
    			my_flag = true ;												
    			break;
    	   
    

    PS: ble_data_send() contains the sd_ble_gatts_hvx() macro. is this a good way to use the BLE_EVT_TX_COMPLETE event before calling sd_ble_gatts_hvx() again?

    5/ 6 * 20 B * 1/0.020 s = 3 kB/s = 48 kbps :this is the theoretical number for me I just need 3 per conn-interval, so : 3 * 20 B * 1/0.020 s = 3 kB/s = 24 kbps

Reply
  • 1/ I still dont understand your question: the numerical value of the throughput you are getting?

    2/ I am sorry but I cant add the complete project so I will show more about the implementation

    3/ ok

    4/ Now the throughput is going well, what I did is that I created a new instance of FIFO to get and send data through my service so I guess I was asking my FIFO for too much work. About the way to handle this, my implementation would be something like:

    	err_code = ble_data_send(&m_data_send, data_packet);
    	if (err_code == BLE_ERROR_NO_TX_PACKETS) 
           {
    			while(my_flag != true)
    			     {
    					//do nothing
    				 }
            
            err_code = ble_data_send(&m_data_send, data_packet);
    		my_flag = false;
           }
    

    and in the ble_evt_handle:

    		case BLE_EVT_TX_COMPLETE:
    			my_flag = true ;												
    			break;
    	   
    

    PS: ble_data_send() contains the sd_ble_gatts_hvx() macro. is this a good way to use the BLE_EVT_TX_COMPLETE event before calling sd_ble_gatts_hvx() again?

    5/ 6 * 20 B * 1/0.020 s = 3 kB/s = 48 kbps :this is the theoretical number for me I just need 3 per conn-interval, so : 3 * 20 B * 1/0.020 s = 3 kB/s = 24 kbps

Children
Related