r3691 | jgn | 2012-08-03 15:34:06 +1000 (Fri, 03 Aug 2012) | 1 line

This commit is contained in:
Jing Chen
2012-08-03 15:34:06 +10:00
committed by Douglas Clowes
parent f2788d66cd
commit f3486b2a17

View File

@@ -146,8 +146,8 @@ int LFGenReading(Ascon *a)
do {
ret = AsconReadChar(a->fd, &chr);
if(ret<=0) {
AsconError(a, "AsconReadChar failed:", 0);
a->state = AsconReadDone;
AsconError(a, "AsconReadChar failed in LFGenReading:", 0);
//a->state = AsconReadDone;
return 0;
} else {
HEAD = (BYTE)chr;
@@ -157,13 +157,13 @@ int LFGenReading(Ascon *a)
// read LEN info
ret = AsconReadChar(a->fd, &chr);
if(ret<=0) {
AsconError(a, "AsconReadChar failed:", 0);
a->state = AsconReadDone;
AsconError(a, "AsconReadChar failed in LFGenReading:", 0);
//a->state = AsconReadDone;
return 0;
}
LEN = (BYTE)chr;
if(LEN<2) {
AsconError(a, "Reading Error from the device, wrong LEN info", 0);
AsconError(a, "Reading Error from the LF AG1010 device, wrong LEN info", 0);
a->state = AsconReadDone;
return 0;
}
@@ -177,8 +177,8 @@ int LFGenReading(Ascon *a)
while(ind<LEN+2) {
ret = AsconReadChar(a->fd, &chr);
if (ret <= 0) {
AsconError(a, "AsconReadChar failed:", 0);
a->state = AsconReadDone;
AsconError(a, "AsconReadChar failed in LFGenReading:", 0);
//a->state = AsconReadDone;
return 0;
}
lfchar[ind] = (BYTE)chr; ind++;