|
@@ -17,7 +17,7 @@ class ShellmattaSerial():
|
|
|
|
|
|
self.transport = ShellmattaTransport(self.com_port, transport_layer_mandatory)
|
|
|
|
|
|
- def send_command(self, command):
|
|
|
+ def send_command(self, command, enter=True):
|
|
|
""" Send command and wait for the prompt in the response. """
|
|
|
|
|
|
if isinstance(command, str):
|
|
@@ -28,7 +28,8 @@ class ShellmattaSerial():
|
|
|
retries = 3
|
|
|
|
|
|
while retries:
|
|
|
- send_data = send_data + b"\r"
|
|
|
+ if enter:
|
|
|
+ send_data += b"\r"
|
|
|
self.transport.write(send_data)
|
|
|
data = b''
|
|
|
|
|
@@ -71,6 +72,9 @@ class ShellmattaSerial():
|
|
|
self.com_port.reset_input_buffer()
|
|
|
self.com_port.reset_output_buffer()
|
|
|
|
|
|
+ # send cancel - and read response from input buffer
|
|
|
+ _result = self.send_command("\x03", enter=False)
|
|
|
+
|
|
|
def close_serial(self):
|
|
|
""" Closes the serial port """
|
|
|
self.com_port.close()
|