API Documentation
v0.0.1
Loading...
Searching...
No Matches
DcsRunningChecker.h
Go to the documentation of this file.
1
#ifndef DCS_RUNNING_CHECKER_H
2
#define DCS_RUNNING_CHECKER_H
3
11
#include <DcsBios.h>
12
13
14
// DCS connection monitoring variables
15
static
int
currDcsHeartbeat = 0;
16
static
int
prevDcsHeartbeat = 0;
17
static
unsigned
long
dcsLastUpdateTime = 0;
18
static
const
unsigned
long
DCS_TIMEOUT_MS = 10000;
19
20
29
bool
checkDcsRunning
() {
30
if
(currDcsHeartbeat != prevDcsHeartbeat) {
31
dcsLastUpdateTime = millis();
32
prevDcsHeartbeat = currDcsHeartbeat;
33
return
true
;
34
}
35
36
// Check if we've exceeded the timeout period
37
if
(millis() - dcsLastUpdateTime >= DCS_TIMEOUT_MS) {
38
// No communication from DCS for over 1 second
39
return
false
;
40
}
41
42
// Within timeout window - assume DCS is still running
43
return
true
;
44
}
45
46
// DCS-BIOS callback for update counter changes
47
void
onDcsUpdateCounterChange(
unsigned
int
newValue) {
48
currDcsHeartbeat = newValue;
49
}
50
DcsBios::IntegerBuffer dcsUpdateCounterBuffer(0xfffe, 0x00ff, 0, onDcsUpdateCounterChange);
51
52
#endif
// DCS_RUNNING_CHECKER_H
checkDcsRunning
bool checkDcsRunning()
Check if DCS World is currently running and sending data.
Definition
DcsRunningChecker.h:29
embedded
OH2_Lower_Instrument_Panel
2A13-BACKLIGHT_CONTROLLER
helpers
DcsRunningChecker.h
Generated on Tue May 5 2026 16:37:05 for API Documentation by
1.12.0