Re: PIC AT Command and CCS
Hi,
why you can't use getc, this not a connection with NL/CR byte, getc read your receive buffer and get the value to a variable :
buffer[n]=getc(); this in RSRX int subroutine
when you recive he will be writen to the variable buffer[].
0A this is a new line. If your modem return always 0A or 0D after string , den you can use both of them to end of the mesage, you will have one flag start package, flag end package.
temp=getc();
if((temp==0x0A || temp==0x0D) & start package)
{
start package=false;
end package = true;
}
else
{
buffer[x]=temp;
x++;
}
in your program you will check end package, and when it's a true you will read data from buffer and make x=0 anf end ackage=false :
if(end package)
{
end package=false
if(buffer[0]='O' && buffer[1]='K' && x==1)
{
do something;
}
}