Accept uA instead of mA in response to '#' as found on 6kV suplies
r2613 | dcl | 2008-06-06 14:18:25 +1000 (Fri, 06 Jun 2008) | 2 lines
This commit is contained in:
@@ -252,7 +252,7 @@ static bool parse_hash(pNHQ200Driv priv, const char* resp, int resp_len)
|
||||
iDst = 0;
|
||||
if (strstr(resp, "V;") == NULL)
|
||||
return false;
|
||||
if (strstr(resp, "mA") == NULL)
|
||||
if (strstr(resp, "mA") == NULL && strstr(resp, "uA") == NULL)
|
||||
return false;
|
||||
while (iSrc < resp_len && resp[iSrc]) {
|
||||
if (resp[iSrc] == ';') {
|
||||
@@ -292,7 +292,7 @@ static bool parse_hash(pNHQ200Driv priv, const char* resp, int resp_len)
|
||||
/* TODO: convert voltage and current */
|
||||
if (strstr(priv->voltage_max, "V") == NULL)
|
||||
return false;
|
||||
if (strstr(priv->current_max, "mA") == NULL)
|
||||
if (strstr(priv->current_max, "mA") == NULL && strstr(priv->current_max, "uA") == NULL)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -439,7 +439,7 @@ static void NHQState_Unknown(pStateMachine sm, pEvtEvent event) {
|
||||
fsm_change_state(sm, NHQState_Idle);
|
||||
return;
|
||||
}
|
||||
snprintf(line, CMDLEN, "Command '%s' response unexpected in substate %d", rqst, sm->mySubState);
|
||||
snprintf(line, CMDLEN, "Command '%s' response '%s' unexpected in substate %d", rqst, resp, sm->mySubState);
|
||||
SICSLogWrite(line, eError);
|
||||
} while (0);
|
||||
/* Unrecognised response - let it settle down before retrying */
|
||||
@@ -522,7 +522,7 @@ static void NHQState_Idle(pStateMachine sm, pEvtEvent event){
|
||||
fsm_tmr_callback, sm);
|
||||
return;
|
||||
}
|
||||
snprintf(line, CMDLEN, "Command '%s' response unexpected in substate %d", rqst, sm->mySubState);
|
||||
snprintf(line, CMDLEN, "Command '%s' response '%s' unexpected in substate %d", rqst, resp, sm->mySubState);
|
||||
SICSLogWrite(line, eError);
|
||||
} while (0);
|
||||
/* Unrecognised response - let it settle down before retrying */
|
||||
@@ -594,7 +594,7 @@ static void NHQState_Raising(pStateMachine sm, pEvtEvent event) {
|
||||
fsm_change_state(sm, NHQState_Idle);
|
||||
return;
|
||||
}
|
||||
snprintf(line, CMDLEN, "Command '%s' response unexpected in substate %d", rqst, sm->mySubState);
|
||||
snprintf(line, CMDLEN, "Command '%s' response '%s' unexpected in substate %d", rqst, resp, sm->mySubState);
|
||||
SICSLogWrite(line, eError);
|
||||
} while (0);
|
||||
/* Unrecognised response - let it settle down before retrying */
|
||||
@@ -675,7 +675,7 @@ static void NHQState_Lowering(pStateMachine sm, pEvtEvent event) {
|
||||
fsm_change_state(sm, NHQState_Idle);
|
||||
return;
|
||||
}
|
||||
snprintf(line, CMDLEN, "Command '%s' response unexpected in substate %d", rqst, sm->mySubState);
|
||||
snprintf(line, CMDLEN, "Command '%s' response '%s' unexpected in substate %d", rqst, resp, sm->mySubState);
|
||||
SICSLogWrite(line, eError);
|
||||
} while (0);
|
||||
/* Unrecognised response - let it settle down before retrying */
|
||||
|
||||
Reference in New Issue
Block a user