bt_nus_send -12(ENOMEM) Error

Hi. I got a problems on send data using  bt_nus_send function.

This is my code for send data

void BLE_PERIPHERAL::Write(uint8_t *data, uint16_t data_length){
	int32_t result = bt_nus_send(NULL, data, data_length);
	printk("Result : %d\n", result);
}

When I call this function for one time per second, there is no problem.

But I call it 40 times per second, bt_nus_send return -12 error.(ENOMEM, maybe)

I need to send data at least 50 time per second. How can I fix it?

Related