File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ use crate::connections::stream_buffer::StreamBuffer;
16
16
17
17
use super :: wrappers:: encoded_data:: IncomingStreamData ;
18
18
19
+ /// Interval for sending heartbeat packets to the radio (in seconds).
20
+ /// Needs to be less than this: https://github.com/meshtastic/firmware/blob/eb372c190ec82366998c867acc609a418130d842/src/SerialConsole.cpp#L8
21
+ pub const SERIAL_HEARTBEAT_INTERVAL : u64 = 5 * 60 ; // 5 minutes
22
+
19
23
pub fn spawn_read_handler < R > (
20
24
cancellation_token : CancellationToken ,
21
25
read_stream : R ,
@@ -212,7 +216,7 @@ where
212
216
debug ! ( "Started heartbeat handler" ) ;
213
217
214
218
loop {
215
- tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( 5 * 60 ) ) . await ;
219
+ tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( SERIAL_HEARTBEAT_INTERVAL ) ) . await ;
216
220
217
221
let mut write_stream = write_stream. lock ( ) . await ;
218
222
@@ -235,6 +239,8 @@ where
235
239
} ,
236
240
) ) ;
237
241
}
242
+
243
+ log:: info!( "Sent heartbeat packet" ) ;
238
244
}
239
245
240
246
// debug!("Heartbeat handler finished");
You can’t perform that action at this time.
0 commit comments