Software Development Kit (SDK)
The Level-D 767-300 is shipped with a Software Development Kit (SDK). It is the first and only add-on aircraft for Microsoft FlightSimulator that offers this feature.
The SDK makes states and controls of the Level-D panel available to external programs, which is great for home cockpit builders.
On this page I will show you how to use the SDK, and how to connect your cockpit hardware to the SDK data, via Opencockpits SIOC variables or with FSUIPC offsets.
The SDK contains a header file LVLD_SDK.h with functions and data definitions in the C-language. It's a rather large file, I will show you just a few examples.
Here are the definitions of the information elements in the Level-D database (representing states in the Level-D cockpit) for the Master Lights:
// Master lights -------------------
int master_warning_light; // BOOL
int master_caution_light; // BOOL
and a C-program snippet that shows how to use such an information element:
#include "LVLD_SDK.h" // import all data definitions
LVLDDATA Lvld; // the level-d database variable
LVLDSession(OPEN, SDK_VERSION); // open a session
ReadLVLDData(&Lvld); // read the level-d database
int warning = Lvld.master_warning_light; // get master warning light
// ... and do something with it!
LVLDSession(CLOSE, SDK_VERSION); // close the session
Compile and link this program with LVLDSDK.lib. Put the LVLDSDK.dll in the same directory as this program. Run the program and you will have accessed the actual Master Warning Light state.
The following example is about controls (for setting switches in the Level-D cockpit). There are lots of them available, but here just the definitions for the autopilot switches of the MCP:
// MCP Commands
#define LVLD_AP_LEFT 1 // Left A/P CMD switch toggle
#define LVLD_AP_CENTER 2 // Center A/P CMD switch toggle
#define LVLD_AP_RIGHT 3 // Right A/P CMD switch toggle
and a program snippet how to use it (note I have left out opening and closing of a session, that is the same as in the example above):
SendLVLDCommand(LVLD_AP_LEFT); // toggles left CMD switch
A working Microsoft Visual Studio 2010 Express C++ project that demonstrates reading the MCP heading value can be downloaded by clicking at the Zip file logo. Note that this example is about a separate program named 'SDKDemo.exe', a console application, that communicates with the Level-D 767 in MS Flight simulator. A slightly different aproach is to communicate from a .dll library or from a gauge. How to do that is indicated in the commentary part of the LVLD_SDK.h file.