This commit is contained in:
Gina Häußge committed 2016-01-27 14:34:00 +01:00
1 parent 34facfe764
commit b7ad8faaee
2 files changed
+21 -2

No files matched your search

@@ -312,7 +312,7 @@ class ReprapGcodeProtocol(Protocol, MotorControlProtocolMixin, FanControlProtoco
def _do_increment_and_send_with_checksum(self, cmd):
with self._line_mutex:
linenumber = self._current_linenumber
self._addToLastLines(cmd)
self._add_to_last_line(cmd)
self._current_linenumber += 1
self._do_send_with_checksum(cmd, linenumber)
+20 -1
View File
@@ -18,9 +18,15 @@ class Transport(object):
return []
def __init__(self, *args, **kwargs):
pass
self._state = TransportState.DISCONNECTED
@property
def state(self):
return self._state
def connect(self, **params):
if self.state == TransportState.CONNECTED:
raise AlreadyConnectedError("Already connected, disconnect first")
options = self.get_connection_options()
param_dict = get_param_dict(params, options)
self.create_connection(**param_dict)
@@ -38,6 +44,19 @@ class Transport(object):
pass
class TransportState(object):
CONNECTED = "connected"
DISCONNECTED = "disconnected"
class NotConnectedError(Exception):
pass
class AlreadyConnectedError(Exception):
pass
class SeparatorAwareTransportWrapper(object):
def __init__(self, transport, separator, chunksize=128):