mirror of
https://github.com/andsyrovatko/s4k-modbus-relay-controller.git
synced 2026-04-21 22:08:54 +02:00
refactor: make modbus controller cross-platform and improve locking
- Added cross-platform file locking using msvcrt (Windows) and fcntl (Unix). - Switched to pathlib for robust path management and automatic directory creation. - Updated is_host_reachable to support Windows ping syntax. - Added atexit handler to ensure lock file descriptors are closed properly. NOTE: Verified on Linux (LMDE 7). Windows compatibility implemented but not yet tested.
This commit is contained in:
+2
-2
@@ -7,5 +7,5 @@ timeout = 1 # Timeout value in seconds
|
||||
max_channel = 7 # Maximum number of channels of the Modbus device model (7 - 0-7, as 8 channels summary)
|
||||
|
||||
[paths]
|
||||
lock_file = /tmp/modbus_controller.lock
|
||||
log_file = /tmp/modbus_controller.log
|
||||
lock_file = modbus_controller.lock
|
||||
log_file = modbus_logs/modbus_controller.log
|
||||
|
||||
Reference in New Issue
Block a user