Well, here it is, the place to gather together material concerning Device Link and its associated software.
I will be using material from this forum in the IL-2 Online Manual so if anybody objects to their material being used please say so.
Devicelink Wrapper Version 1.1.
In this zip file I included the devicelink.cpp and devicelink.h wrapper class files. You can link these in directly to your project. I also threw in a Visual Studio 6 Project file and Workspace file for building it as a library if you wanted. There is also a sample config.ini file as well.
Most of the functions are commented. I didn't include all the possible devicelink commands in the headers as I tend to create them as I need but there is enough there to use as an example if you add more.
As time goes on I will be updating this from time to time. Mostly adding new functions and will strive to make it backwards compatible.
Now, for the legal stuff.
Use at your own risk. You break something don't blame me. I've provided the raw code so you can examine it yourself. You are allowed to re-use this code in any product private or commercial I only ask that I receive credit if you do. I would also appreciate any feedback on bugs you find.
int main(int argc, char* argv[])
{
if (argc > 1) //if filename provided dump messages to it
{
output = fopen(argv[1],"a+");
} else //else send output to the console
{
output = stderr;
}
C_DeviceLink my_dl;
if (my_dl.Init(output) != TRUE)
{
fprintf(output,"Device Link failed to initialize!\n");
return 0; //quit the program
}
// example commands already written. Can be used as examples for further commands
my_dl.SetGearUp(); //raise the gear
my_dl.SetGearDown(); //lower the gear
my_dl.ToggleGear(); //toggle the position of the gear
my_dl.StartEng1();
my_dl.StartEng2();
my_dl.ToggleNavLights();
my_dl.ToggleLandLights();
my_dl.ToggleCockpitLights();
} //end prog
Users browsing this forum: No registered users and 2 guests