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:
Jeremy Gallant
2025-07-24 10:15:27 -04:00
committed by GitHub
co-authored by philon-
parent 5b417a321a
commit 50ca75da0e
4 changed files with 37 additions and 2 deletions
@@ -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();
};