-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbms.cpp
More file actions
35 lines (33 loc) · 1 KB
/
bms.cpp
File metadata and controls
35 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <windows.h>
#include "bms.h"
int main(int argc, char** argv) {
FlightData* flightData;
do {
flightDataMemHandle = OpenFileMapping(FILE_MAP_ALL_ACCESS, TRUE,
TEXT("FalconSharedMemoryArea"));
if(!flightDataMemHandle) {
std::cout << "Unable to open file. Is Falcon Running?" << std::endl;
} else {
std::cout << "Got Shared Memory" << std::endl;
}
} while (!flightDataMemHandle);
flightData = (FlightData*) MapViewOfFile(flightDataMemHandle,
FILE_MAP_ALL_ACCESS, 0, 0, 0);
while (TRUE) {
// std::cout << flightData->IsSet(FlightData::AOAOn) << std::endl;
std::cout << flightData->gs << std::endl;
for (int i = 0; i < 5; i++) {
for (int x = 0; x < 25; x++) {
std::cout << flightData->DEDLines[i][x] << ",";
}
std::cout << std::endl;
}
}
// Close shared memory area
if (flightData) {
UnmapViewOfFile(flightData);
flightData = NULL;
}
CloseHandle(flightDataMemHandle);
return 0;
}