r3693 | jgn | 2012-08-03 16:14:38 +1000 (Fri, 03 Aug 2012) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
9281ebf4dd
commit
1993aa2c11
@@ -143,21 +143,27 @@ int LFGenReading(Ascon *a)
|
||||
//BYTE HEAD, LEN, CTRL, CRC=0, *Data=NULL;
|
||||
|
||||
// Read HEAD info
|
||||
do {
|
||||
ret = AsconReadChar(a->fd, &chr);
|
||||
if(ret<=0) {
|
||||
AsconError(a, "AsconReadChar failed in LFGenReading:", 0);
|
||||
ret = AsconReadChar(a->fd, &chr);
|
||||
while (ret>0) {
|
||||
HEAD = (BYTE)chr;
|
||||
if (HEAD!=0x96) {
|
||||
ret = AsconReadChar(a->fd, &chr);
|
||||
continue;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if(ret<0) {
|
||||
AsconError(a, "AsconReadChar failed in Head Info reading in LFGenReading:", 0);
|
||||
//a->state = AsconReadDone;
|
||||
return 0;
|
||||
} else {
|
||||
HEAD = (BYTE)chr;
|
||||
}
|
||||
} while (HEAD!=0x96);
|
||||
|
||||
}
|
||||
|
||||
// read LEN info
|
||||
ret = AsconReadChar(a->fd, &chr);
|
||||
if(ret<=0) {
|
||||
AsconError(a, "AsconReadChar failed in LFGenReading:", 0);
|
||||
if(ret<0) {
|
||||
AsconError(a, "AsconReadChar failed in LEN reading in LFGenReading:", 0);
|
||||
//a->state = AsconReadDone;
|
||||
return 0;
|
||||
}
|
||||
@@ -176,7 +182,7 @@ int LFGenReading(Ascon *a)
|
||||
// read all other chars
|
||||
while(ind<LEN+2) {
|
||||
ret = AsconReadChar(a->fd, &chr);
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
AsconError(a, "AsconReadChar failed in LFGenReading:", 0);
|
||||
//a->state = AsconReadDone;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user