Slazi Posted March 25, 2016 Posted March 25, 2016 I am looking to capture DCS UDP output via an .exe coded in c++. Specifically, I'm interested in capturing Mi-8 Doppler radar output. For now, all I want to do is display that output (in a human readable format). I have further plans for the data later. I was not so familiar with networking and sending data around on PCs, but I've figured out how to send and receive data between different executables over UDP thanks to a nice tutorial: http://gafferongames.com/networking-for-game-programmers/sending-and-receiving-packets/ My understanding is DCS is able to output data to UDP. To do this, I think I have to create an export.lua which controls what data is exported? It also sets up ports. I have to place this into my C:\Users\User\Saved Games\DCS\Scripts folder. If I wanted to export Mi-8 Doppler radar output, how complicated is it? Ideally, I would also grab a little other data while I'm at it. Aircraft position in the game world, altimeter, speed etc.. There are a lot of links floating around the forums that link to different parts of this, but it's kinda hard to figure out exactly which advice I should be following. References: 1. a) Designing a common Export.lua file (2015) http://forums.eagle.ru/showthread.php?t=149392 b) based on this thread (2015) - http://forums.eagle.ru/showthread.php?p=2507326#post2507326 This contains a list of the current software which use export.lua files. c) This in turn results in this: A common Export.lua file for DCS: World (updated 2015) https://github.com/jboecker/dcs-export-core 2. catching UDP packets from DCS (2015) http://forums.eagle.ru/showthread.php?t=140772 3. Example of output/input via TCP/UDP (2012) http://forums.eagle.ru/showthread.php?t=97960 4. Gadroc's post on his export.lua (2010) http://forums.eagle.ru/showpost.php?p=1035610&postcount=15 5. Java TCP/IP resource (2012): http://forums.eagle.ru/showthread.php?t=84118 To start off, I would just like some kind of export.lua that sends something for my UDP program to hook into. I would like for this post to help other people in similar situations. Thanks, Slazi(a)
Slazi Posted March 26, 2016 Author Posted March 26, 2016 Would this be better in the mods / apps how to section?
Capt Zeen Posted March 30, 2016 Posted March 30, 2016 Hello slazi. You can take a look to my export.lua There i export all the data from the mi-8. You can find it in the mi-8 profile, in the download section. http://www.captzeen.com 1 Capt_Zeen_HELIOS PROFILES_WEBSITE Capt_Zeen_Youtube Channel
Slazi Posted April 1, 2016 Author Posted April 1, 2016 (edited) Update: Using DCS-BIOS, I can get updates to my program. I just needed to alter BiosConfig.lua: I changed the following: -- BIOS.protocol_io.UDPSender:create({ port = 7777, host = "192.168.1.177" }), BIOS.protocol_io.UDPSender:create({ port = 7777}), Now I'm getting around 100 - 160 bytes out per updates. My next step is decoding the messages. The average message appears as "UUUU" and one other character (often a face, a star, the music character). EDIT The first four characters are UUUU. I guess I have to decode the remaining characters. Edited April 1, 2016 by Slazi
FSFIan Posted April 1, 2016 Posted April 1, 2016 (edited) The DCS-BIOS data format is described in the DCS-BIOS developer guide. It also describes how to connect with multicast UDP or TCP, which don't require editing BIOSConfig.lua. As you are writing your program in C++, you may be interested in the ProtocolParser::processChar() method in the Arduino library, which implements the state machine to parse that data stream. Edited April 1, 2016 by [FSF]Ian DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Slazi Posted April 2, 2016 Author Posted April 2, 2016 Great! Thank you, Ian. I'll take a look into that now.
Slazi Posted April 3, 2016 Author Posted April 3, 2016 My simple brain is having trouble understanding it all, but I'm slowly making a little progress. I may have a couple of more questions for you soon.
Slazi Posted April 6, 2016 Author Posted April 6, 2016 I'll try and work on this again on the weekend if I can. I still don't understand how the data is being encoded and sent. I can decode the module name, e.g. Mi-8MT, but I haven't figured out how all the strings, ints, floats are wrapped or split up yet.
Recommended Posts