Commit 9ba7bd54 authored by Adam Wujek's avatar Adam Wujek

WIP: [WRS BUG: 244] Do not fail handshake if wrong frame received

Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 7d616547
......@@ -31,6 +31,8 @@ void wr_handshake_fail(struct pp_instance *ppi)
pp_diag(ppi, ext, 1, "Handshake failure: now non-wr %s\n",
wrp->wrMode == WR_MASTER ? "master" : "slave");
pp_error("Handshake failure: now non-wr %s\n",
wrp->wrMode == WR_MASTER ? "master" : "slave");
wrp->next_state=WRS_IDLE;
wr_reset_process(ppi,WR_ROLE_NONE);
wr_servo_reset(ppi);
......
......@@ -41,7 +41,7 @@ int wr_calibrated(struct pp_instance *ppi, void *buf, int len, int new_state)
wrp->next_state = WRS_WR_LINK_ON;
} else {
pp_diag(ppi, ext, 1, "WR: Invalid msgId(x%04x) received. %s was expected\n", wrMsgId, "CALIBRATE/WR_MODE_ON");
wr_handshake_fail(ppi);
pp_error("WR: Invalid msgId(x%04x) received. %s was expected\n", wrMsgId, "CALIBRATE/WR_MODE_ON");
}
return 0;
......
......@@ -35,7 +35,7 @@ int wr_locked(struct pp_instance *ppi, void *buf, int len, int new_state)
wrp->next_state= WRS_RESP_CALIB_REQ;
} else {
pp_diag(ppi, ext, 1, "WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "CALIBRATE");
wr_handshake_fail(ppi);
pp_error("WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "CALIBRATE");
}
return 0;
}
......
......@@ -35,7 +35,7 @@ int wr_m_lock(struct pp_instance *ppi, void *buf, int len, int new_state)
wrp->next_state = WRS_CALIBRATION;
} else {
pp_diag(ppi, ext, 1, "WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "LOCKED");
wr_handshake_fail(ppi);
pp_error("WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "LOCKED");
}
return 0;
}
......
......@@ -37,7 +37,7 @@ int wr_present(struct pp_instance *ppi, void *buf, int len, int new_state)
wrp->next_state = WRS_S_LOCK;
} else {
pp_diag(ppi, ext, 1, "WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "LOCK");
wr_handshake_fail(ppi);
pp_error("WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "LOCK");
}
return 0;
}
......
......@@ -37,7 +37,7 @@ int wr_resp_calib_req(struct pp_instance *ppi, void *buf, int len, int new_state
WRS_CALIBRATION;
} else {
pp_diag(ppi, ext, 1, "WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "CALIBRATED");
wr_handshake_fail(ppi);
pp_error("WR: Invalid msgId(x%04x) received. %s was expected\n",wrMsgId, "CALIBRATED");
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment