nick703
Advanced Member level 1
hello i have completely configure UART to receive and send data using serial port. in this configure below is my code
All this working properly with predefined command using serial port means in serial port i have send {3QFG} , {START} all command send and working completely.
But Now problem is suppose i send unknown command with unknown length that time My controller serial port is hang. so how to handle this stuff i didn't know. please give me advise to resolve this problem.
Code:
int main (void)
{
initAll() ; // configure uart and all other parameter
while(1)
{
if(!strncmp(C, "{3QFG}", sizeof("{3QFG}")))
{
mLED_1_Off();
}
else if(!strncmp(C, "{START}", sizeof("{START}")))
{
mLED_1_Off();
}
}
}
All this working properly with predefined command using serial port means in serial port i have send {3QFG} , {START} all command send and working completely.
But Now problem is suppose i send unknown command with unknown length that time My controller serial port is hang. so how to handle this stuff i didn't know. please give me advise to resolve this problem.