Qutbuddin
Newbie level 4
Hi Everyone,
I am doing a project using gsm. I want to receive string from UART and compare it with the predefined string.But somehow I am not able to get string from UART. Below is my code
void recieve_string()
{ unsigned char p;
while(RI!=0)
{
p=SBUF;
z=p;
i++;
}while(p!='\0');
RI=0;
compare_string();
}
void compare_string()
{
if(strcmp(z,a)==0){
relay=1;
}
else if(strcmp(z,b)==0){
relay=0;
}
I am doing a project using gsm. I want to receive string from UART and compare it with the predefined string.But somehow I am not able to get string from UART. Below is my code
void recieve_string()
{ unsigned char p;
while(RI!=0)
{
p=SBUF;
z=p;
i++;
}while(p!='\0');
RI=0;
compare_string();
}
void compare_string()
{
if(strcmp(z,a)==0){
relay=1;
}
else if(strcmp(z,b)==0){
relay=0;
}