While checking why I cannot connect to GPRS in https://community.nxp.com/thread/380640 I am going through source code and I found a bug in ppphdlc.c
There are 3 loops with this code:
if(fgetc(ppphdlc_ptr->DEVICE) == PPPHDLC_FLAG)
{
wait=0;
}
there is wait--; on the next line, so it will become 0xFFFFFFFF and the loop doesn't end immediately
I would suggest to repair it like:
if(fgetc(ppphdlc_ptr->DEVICE) == PPPHDLC_FLAG)
{
wait=0;
continue;
}
BTW: wouldn't it be better to do things like this (protocol parsing) with state machine?
PS: is this the right place to write things like this, or should I report it somewhere else so that it gets to the right people?
Solved! Go to Solution.
Hi Martin:
We have noticed this bug and reported it to the developer team, thank you for your sharing.
Regards
Daniel
Hi Martin:
We have noticed this bug and reported it to the developer team, thank you for your sharing.
Regards
Daniel