Fix _listen_until_online to have the desired behavior
Before you sometimes had to connect twice to actually connect because the M105 was sent before the printer's Serial module actually became ready. Now when no data is available to read on the Serial line a new M105 is sent until connection is established.master
parent
6f7ecce7ff
commit
17e8436436
|
@ -138,7 +138,7 @@ class printcore():
|
||||||
self._send("M105")
|
self._send("M105")
|
||||||
while self._listen_can_continue():
|
while self._listen_can_continue():
|
||||||
line = self._readline()
|
line = self._readline()
|
||||||
if line == None:
|
if not line:
|
||||||
break
|
break
|
||||||
if line.startswith(tuple(self.greetings)) or line.startswith('ok'):
|
if line.startswith(tuple(self.greetings)) or line.startswith('ok'):
|
||||||
if self.onlinecb:
|
if self.onlinecb:
|
||||||
|
|
Loading…
Reference in New Issue