mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-11-21 09:31:16 -08:00
Fix Linux Serial port selection
This commit is contained in:
1 parent
72b48235f5
commit
296bc078eb
2 files changed
+7
-4
No files matched your search
+3
-2
@@ -86,7 +86,8 @@ class Camera:
|
||||
self.config.capture_source is not None
|
||||
and self.config.capture_source != ""
|
||||
):
|
||||
if "COM" in str(self.config.capture_source):
|
||||
ports = ("COM", "/dev/ttyACM")
|
||||
if any(x in str(self.config.capture_source) for x in ports):
|
||||
if (
|
||||
self.serial_connection is None
|
||||
or self.camera_status == CameraState.DISCONNECTED
|
||||
@@ -150,7 +151,7 @@ class Camera:
|
||||
if should_push and not self.capture_event.wait(timeout=0.02):
|
||||
continue
|
||||
if self.config.capture_source is not None:
|
||||
ports = ("COM", "/dev/tty")
|
||||
ports = ("COM", "/dev/ttyACM")
|
||||
if any(x in str(self.config.capture_source) for x in ports):
|
||||
self.get_serial_camera_picture(should_push)
|
||||
else:
|
||||
|
||||
@@ -319,8 +319,10 @@ class CameraWidget:
|
||||
# if value not in self.camera_list:
|
||||
# self.config.capture_source = value
|
||||
# if "COM" not in value:
|
||||
ports = ("COM", "/dev/tty")
|
||||
ports = ("COM", "/dev/ttyACM")
|
||||
print(f"Value: {value}")
|
||||
if any(x in str(value) for x in ports):
|
||||
print("SERIAL PORT")
|
||||
self.config.capture_source = value
|
||||
else:
|
||||
cam = get_camera_index_by_name(value) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
|
||||
@@ -344,7 +346,7 @@ class CameraWidget:
|
||||
and ".mp4" not in value
|
||||
and "udp" not in value
|
||||
and "COM" not in value
|
||||
and "/dev/tty" not in value
|
||||
and "/dev/ttyACM" not in value
|
||||
and value not in self.camera_list
|
||||
): # If http is not in camera address, add it.
|
||||
self.config.capture_source = (
|
||||
|
||||
Reference in new issue
Block a user