// #define UART_DATA_SIZE (EXTENDED_ADV_ENABLE ? 280 : 72) // increase or decrease 16bytes for each step.
#define UART_DATA_SIZE (2048 - 4 - 4) // fyb change bigger for ota data
int blc_rx_from_uart (void)
{
uart_ErrorCLR();
uart_data_t* p = (uart_data_t *)my_fifo_get(&hci_rx_fifo);
if(p){
u32 rx_len = p->len & 0xffff ; //usually <= 255 so 1 byte should be sufficient //0xff change to 0xffff
LOG_USER_MSG_INFO(0,0,"rx_num %d\r\n",rx_len);
if (rx_len)
{
#if 0 // Serial loop test
#if 1
if(0 == my_fifo_push_hci_tx_fifo(p->data, rx_len, 0, 0));
#else
if(uart_Send(p->data, rx_len))
#endif
{
my_fifo_pop(&hci_rx_fifo);
}
#else
app_hci_cmd_from_usb_handle(p->data, rx_len);
my_fifo_pop(&hci_rx_fifo);
#endif
}
}
return 0;
}