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

multi packets per connection interval

HI,I want to send multi packets per connection interval. I have checked some questions and thread. like thislink text and thislink text.

according to the example throughput , i think i can use the data_send function to achieve multi packets per interval.

since i am using ble_uart example, i add data_send() function and put it in while loop to send data continuously. the data_send code is as follow:

static void data_send(){
uint32_t err_code;
  int n=0;
static uint8_t data[500] = {8};

  err_code=ble_lbs_data_send(&m_lbs, data);
if (err_code != NRF_SUCCESS &&
        err_code != BLE_ERROR_INVALID_CONN_HANDLE &&
        err_code != NRF_ERROR_INVALID_STATE &&
        err_code != BLE_ERROR_NO_TX_BUFFERS)
   {
        APP_ERROR_CHECK(err_code);
   }  }

main function is that

int main(void){

  uint32_t err_code_uart,err_code;
  bool erase_bonds;
  uint8_t  start_string[] = START_STRING;

    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS_BLE, APP_TIMER_OP_QUEUE_SIZE_BLE, false);
  uart_init();
  buttons_leds_init(&erase_bonds);
  ble_stack_init();
  gap_params_init();    
  services_init();
  advertising_init();
  conn_params_init();
    err_code_uart = ble_advertising_start(BLE_ADV_MODE_FAST);
  APP_ERROR_CHECK(err_code_uart);


	m_transfer_completed = false;

// Setup bsp module.

	
uint8_t data[500]={0};
	int i=0,count=1;
while(1)
   {
		 
           data_send();
			// ble_nus_string_send(&m_nus, data, 20);

   }}

the question is when i used data_send(); function to send data, there is no data received in MCP while when i use ble_nus_string_send function, it works.

Can anyone help?

Thank You

Related