Hi,
I am trying to read some data from UART, and put it in the variable Rxbuffersize and then I am making a comparison between the Received data and the expected data. But what I see on my terminal is not what I send, which is UART_1_PutString("11");
Do anybody have clue about what is wrong?
RegardsCode:#include <project.h> char Rxbuffersize[3]; char i = 0; uint8 ans = 0; char response[100] = {0}; char x = 0; int main() { UART_1_Start(); CyGlobalIntEnable if(UART_1_GetRxBufferSize() != 0){ // Returns the number of received bytes remaining in the RX buffer Rxbuffersize[i++] = UART_1_GetChar(); // Get the bytes and put it in the array if (strstr(Rxbuffersize, "1011") != NULL) //compare the two; { UART_1_PutString("11"); //print this out; ans = 1; } } while(ans == 0); }