If the S (set) command fails it should be reported as an error.
r2920 | ffr | 2010-05-12 17:35:17 +1000 (Wed, 12 May 2010) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
b0fd7636b4
commit
bc3471bb98
@@ -215,26 +215,29 @@ int RFAmpReading (Ascon *a)
|
|||||||
strcpy(errMsg, "ANSRFAMP: Step size should be <= 5 for current");
|
strcpy(errMsg, "ANSRFAMP: Step size should be <= 5 for current");
|
||||||
GetReplyFailed = 1;
|
GetReplyFailed = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (data->transactInProg == txCheckReply) {
|
} else if (data->transactInProg == txCheckReply) {
|
||||||
// TODO Compare rdBuffer to rfCmd if they match then set replyStr="OK" else set error message
|
// TODO Compare rdBuffer to rfCmd if they match then set replyStr="OK" else set error message
|
||||||
char tmpCurr[3], tmpFreq[4];
|
char tmpCurr[3], tmpFreq[4];
|
||||||
unsigned char tmpSwitchs;
|
unsigned char tmpSwitchs;
|
||||||
|
|
||||||
strncpy(tmpCurr, &data->rfCmd[3], 2);
|
strncpy(tmpCurr, &data->rfCmd[3], 2);
|
||||||
strncpy(tmpFreq, &data->rfCmd[5], 3);
|
strncpy(tmpFreq, &data->rfCmd[5], 3);
|
||||||
tmpSwitchs = (unsigned char)data->rfCmd[8];
|
tmpSwitchs = (unsigned char)data->rfCmd[8];
|
||||||
|
|
||||||
if((atoi(curr) != atoi(tmpCurr)) ||
|
if( (atoi(curr) != atoi(tmpCurr)) ||
|
||||||
(atoi(freq) != atoi(tmpFreq)) ||
|
(atoi(freq) != atoi(tmpFreq)) ||
|
||||||
((switches & 0x7F) != (tmpSwitchs & 0x7F))){
|
((switches & 0x7F) != (tmpSwitchs & 0x7F)) ) {
|
||||||
DynStringReplace(a->rdBuffer, "Warning: Writting Device Error!", 0);
|
strcpy(errMsg, "ANSRFAMP: the (S)ET command failed");
|
||||||
}else
|
GetReplyFailed = 1;
|
||||||
DynStringReplace(a->rdBuffer, "OK", 0);
|
break;
|
||||||
|
} else {
|
||||||
|
DynStringReplace(a->rdBuffer, "OK", 0);
|
||||||
|
}
|
||||||
|
|
||||||
a->state = AsconReadDone;
|
a->state = AsconReadDone;
|
||||||
data->transactInProg = txNormalRead;
|
data->transactInProg = txNormalRead;
|
||||||
} else if (data->transactInProg == txNormalRead) {
|
} else if (data->transactInProg == txNormalRead) {
|
||||||
K3 = (switches & 0x08) >> 3;
|
K3 = (switches & 0x08) >> 3;
|
||||||
K2 = (switches & 0x04) >> 2;
|
K2 = (switches & 0x04) >> 2;
|
||||||
K1 = (switches & 0x02) >> 1;
|
K1 = (switches & 0x02) >> 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user