If you are asking a question, please follow this template:
- My goal is:
[Send received data from MG_EV_HTTP_CHUNK to UART] - My actions are:
[
void HttpEvent_cb(struct mg_connection *connect, int event, void *evtData, void *data2)
{
int avail;
switch(event)
{
case MG_EV_HTTP_CHUNK:
avail=mgos_uart_write_avail(UART_NO);
LOG(LL_INFO, (“MG_EV_HTTP_CHUNK : len=%d : %d”,msg->body.len, avail));
if (msg->body.len)
{ // Send UART max just for testing
mgos_uart_write(msg->body.p, 255);
}
connect->flags |= MG_F_DELETE_CHUNK;
break;
]
- The result I see is:
[
By checking the mgos_uart_write_avail(), the UART data will not be empty until MG_EV_CLOSE is received.
] - My expectation & question is:
[
Should the UART able to send out while HTTP event still active ?
I try to send the data to PC for analysis. But the site has over 20KB of data from MG_EV_HTTP_CHUNK which not possible to store all data before sending.
]