Send heartbeat package to keep serial alive (#732)
* Send heartbeat package to keep the serial connection alive * Update meshDevice.ts --------- Co-authored-by: philon- <philon-@users.noreply.github.com>
This commit is contained in:
1 parent
5b417a321a
commit
50ca75da0e
4 files changed
+37
-2
No files matched your search
@@ -36,6 +36,10 @@ export const BLE = ({ closeDialog }: TabElementProps) => {
|
||||
setSelectedDevice(id);
|
||||
device.addConnection(connection);
|
||||
subscribeAll(device, connection, messageStore);
|
||||
|
||||
const HEARTBEAT_INTERVAL = 5*60*1000;
|
||||
connection.setHeartbeatInterval(HEARTBEAT_INTERVAL);
|
||||
|
||||
closeDialog();
|
||||
};
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ export const Serial = ({ closeDialog }: TabElementProps) => {
|
||||
device.addConnection(connection);
|
||||
subscribeAll(device, connection, messageStore);
|
||||
|
||||
const HEARTBEAT_INTERVAL = 5*60*1000;
|
||||
connection.setHeartbeatInterval(HEARTBEAT_INTERVAL);
|
||||
|
||||
closeDialog();
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user