by WWSensei on Tue Feb 14, 2006 5:57 am
Well, assumming you have all the config files set correctly all you need to do is extantiate an object of the devicelink class and then use the methods accordingly...
in your main you could declare something like:
C_DeviceLink my_dl;
my_dl.Init(); // this creates the devicelink object and initializes the primary UDP client connection
my_dl.SetGearUp(); //raises the gear if down
my_dl.SetGearDown(); //lowers the gear if up
my_dl.ToggleNavLights(); //what else? toggles nav lights
my_dl.ToggleCockpitLights(); //ditto
float left,right,nose;
left=0.00;
righty=0.00;
nose=0.00;
left = my_dl.GetGearPos(DL_GET_LEFT_GEAR_POS);
right= my_dl.GetGearPos(DL_GET_RIGHT_GEAR_POS);
nose = my_dl.GetGearPos(DL_GET_CENTER_GEAR_POS);
my_dl.StartEng1(); //starts engine one
my_dl.StartEng2(); //starts engine 2
my_dl.SelectEng1(); //selects Engine 1
//To get the engine cycliner temp do the following:
my_dl.Set_Temp_Cyl(1); //queries server for Engine 1 cylinder temp
float eng1_temp = my_dl.Get_Temp_Cyl(1); //retrieves cylinder temp for engine one from private var and assigns to new variable. Thread safe.
char ac_id[64]; //allocate 64 byte string buffer
my_dl.GetAircraftID(ac_id); //returns aircraft ID and assigns to buffer ac_id.
Hope this helps.