You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code for the ACK handling of K3Engraver looks wrong.
I would have expected the following behavior in waitForACK():
wait until the expected ACK response is received or a timeout occurs
on timeout, raise an Exception so that the whole lasercutting process stops
The actual code does the following:
In the standard case, waitForACK() waits for 0x09 ("OK") and then returns this value to the caller.
If it does not receive this value after several tries, then it simply returns whatever byte was received last, or 0 if nothing was received at all.
On timeout, only a warning is printed but the code does not seem to react to the timeout in most cases.
In most cases the return value of waitForACK() is ignored.
In rare cases the code checks for a return value of 1 (not 0x09!) and does something special.
The code for the ACK handling of K3Engraver looks wrong.
I would have expected the following behavior in
waitForACK()
:The actual code does the following:
In the standard case,
waitForACK()
waits for0x09
("OK") and then returns this value to the caller.If it does not receive this value after several tries, then it simply returns whatever byte was received last, or
0
if nothing was received at all.LibLaserCut/src/main/java/de/thomas_oster/liblasercut/drivers/K3EngraverDriver.java
Lines 289 to 303 in c2bee3a
On timeout, only a warning is printed but the code does not seem to react to the timeout in most cases.
In most cases the return value of
waitForACK()
is ignored.In rare cases the code checks for a return value of
1
(not0x09
!) and does something special.LibLaserCut/src/main/java/de/thomas_oster/liblasercut/drivers/K3EngraverDriver.java
Lines 340 to 347 in c2bee3a
I don't have such a lasercutter. Maybe @mariolukas can help?
The text was updated successfully, but these errors were encountered: