mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-30 00:39:16 +02:00
serialport reconnect rework - v1.3.0.1
This commit is contained in:
@@ -425,6 +425,18 @@ function handleData(wss, receivedData, rdsWss) {
|
||||
}
|
||||
}
|
||||
|
||||
// Serialport retry code when port is open but communication is lost (additional code in index.js)
|
||||
isSerialportAlive = true;
|
||||
lastFrequencyAlive = '87.500';
|
||||
setInterval(() => {
|
||||
lastFrequencyAlive = initialData.freq;
|
||||
// Activate serialport retry if handleData has not been executed for over 10 seconds
|
||||
if (((Date.now() - lastUpdateTime) > 8000) && !isSerialportRetrying && serverConfig.xdrd.wirelessConnection === false) {
|
||||
isSerialportAlive = false;
|
||||
isSerialportRetrying = true;
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
function showOnlineUsers(currentUsers) {
|
||||
dataToSend.users = currentUsers;
|
||||
initialData.users = currentUsers;
|
||||
|
||||
Reference in New Issue
Block a user