aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/serialhdl.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-02-07 16:03:39 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-03-13 11:29:41 -0500
commit8b4ad34e22245694fad76e4856afd37f7478b3d6 (patch)
treeea78f2b1109e512bb8b10232309c9efef4bb49c1 /klippy/serialhdl.py
parent9572ad43274b68348b250f5a703b1f7c2e77545f (diff)
downloadkutter-8b4ad34e22245694fad76e4856afd37f7478b3d6.tar.gz
kutter-8b4ad34e22245694fad76e4856afd37f7478b3d6.tar.xz
kutter-8b4ad34e22245694fad76e4856afd37f7478b3d6.zip
serialqueue: Support sending messages over a CAN bus
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialhdl.py')
-rw-r--r--klippy/serialhdl.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py
index d17993b9..0d03b1bb 100644
--- a/klippy/serialhdl.py
+++ b/klippy/serialhdl.py
@@ -72,10 +72,11 @@ class SerialReader:
# Done
return identify_data
identify_data += msgdata
- def _start_session(self, serial_dev):
+ def _start_session(self, serial_dev, serial_fd_type='u', client_id=0):
self.serial_dev = serial_dev
self.serialqueue = self.ffi_main.gc(
- self.ffi_lib.serialqueue_alloc(serial_dev.fileno(), 0),
+ self.ffi_lib.serialqueue_alloc(serial_dev.fileno(),
+ serial_fd_type, client_id),
self.ffi_lib.serialqueue_free)
self.background_thread = threading.Thread(target=self._bg_thread)
self.background_thread.start()
@@ -142,7 +143,7 @@ class SerialReader:
self.serial_dev = debugoutput
self.msgparser.process_identify(dictionary, decompress=False)
self.serialqueue = self.ffi_main.gc(
- self.ffi_lib.serialqueue_alloc(self.serial_dev.fileno(), 1),
+ self.ffi_lib.serialqueue_alloc(self.serial_dev.fileno(), 'f', 0),
self.ffi_lib.serialqueue_free)
def set_clock_est(self, freq, last_time, last_clock):
self.ffi_lib.serialqueue_set_clock_est(