added hasSignal(), log signal loss and acquisition

This commit is contained in:
john30
2015-01-31 19:03:31 +01:00
parent 430d72daed
commit e0f4c3609c
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -628,6 +628,12 @@ result_t BusHandler::setState(BusState state, result_t result, bool firstRepetit
logDebug(lf_bus, "%s during %s, switching to %s", getResultCode(result), getStateCode(m_state), getStateCode(state)); logDebug(lf_bus, "%s during %s, switching to %s", getResultCode(result), getStateCode(m_state), getStateCode(state));
else if (m_currentRequest != NULL || state == bs_sendCmd || state == bs_sendResAck || state == bs_sendSyn) else if (m_currentRequest != NULL || state == bs_sendCmd || state == bs_sendResAck || state == bs_sendSyn)
logDebug(lf_bus, "switching from %s to %s", getStateCode(m_state), getStateCode(state)); logDebug(lf_bus, "switching from %s to %s", getStateCode(m_state), getStateCode(state));
if (state == bs_noSignal)
logError(lf_bus, "signal lost");
else if (m_state == bs_noSignal)
logNotice(lf_bus, "signal acquired");
m_state = state; m_state = state;
if (state == bs_ready || state == bs_skip) { if (state == bs_ready || state == bs_skip) {
+6
View File
@@ -320,6 +320,12 @@ public:
*/ */
void formatScanResult(ostringstream& output); void formatScanResult(ostringstream& output);
/**
* Return true when a signal on the bus is available.
* @return true when a signal on the bus is available.
*/
bool hasSignal() { return m_state != bs_noSignal; }
private: private:
/** /**