Skip to content

Commit 0944af3

Browse files
committed
Add default value for rs485-settings in class Serial init
Since this class might use for other python script directly. Add default value to prevent init failed while calling by other python script
1 parent a18eb05 commit 0944af3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contrib/checkbox-ce-oem/checkbox-provider-ce-oem/bin/serial_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ def __init__(
7575
self.stopbits = stopbits
7676
self.timeout = timeout
7777
self.data_size = data_size
78-
self.rs485_settings = rs485_settings
78+
self.rs485_settings = rs485_settings or {
79+
"rts_level_for_tx": False, # Default to False
80+
"rts_level_for_rx": False, # Default to False
81+
"delay_before_tx": 0.0, # Default to 0.0
82+
"delay_before_rx": 0.0, # Default to 0.0
83+
}
7984
self.ser = self.serial_init(node)
8085
self.group = []
8186
for ser in group:

0 commit comments

Comments
 (0)