Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I am using this UART Setup and UART Messages Over Webpage code in wiced sdk 2.4.0 , i want to transmit and receive every 10 minutes. Data has to be received only when the transmission is successful. I have modified the code like this
static void uart_rx_data_thread(uint32_t arg)
uart_info_t* uart_info = (uart_info_t*) arg;
int idx = 0;
wiced_rtos_delay_milliseconds(600000); //10 min
if (wiced_uart_transmit_bytes(uart_info->uart_id, str,7) == WICED_SUCCESS)
while (wiced_uart_receive_bytes(uart_info->uart_id, &c, 1, WICED_NEVER_TIMEOUT) == WICED_SUCCESS)
wiced_uart_transmit_bytes(uart_info->uart_id, &c,1); // This i have given to find whether iam receiving the data properly are not
if (!(c == uart_info->delimeter))
rxBuf[idx++] = c;
if (c == uart_info->delimeter && strlen(rxBuf) > 0)
rxBuf[idx++] = '\0';
rx_end_index = (rx_end_index + 1) % HISTORY_LEN;
idx = 0;
WPRINT_APP_INFO(("Transmit not success"));
I have given delay so that it will transmit data after every 10 min. I want to receive the data only after 10 min and display it in the webpage. But if i receive the data in between 10min that data should not get displayed in the webpage.
But in this code if i receive the data in between 10 min that data is getting displayed in webpage at 10th min.
why it is happening. I don't want this data to be received. please help me to solve this issue.
When any data is received by the radio, it is stored into a buffer by lower level code until the user asks for it via the wiced_uart_receive_bytes method. In other words, when you call wiced_uart_receive_bytes, it is just checking to see if data exists in the buffer, and returning a packet if it does.
What it sounds like you want to do is throw away data until it's been 10 minutes since the last 'good' piece of data has been received.