Skip to content

DCS‐BIOS in a nutshell

Jerker Dahlblom edited this page Sep 19, 2023 · 15 revisions

Sending

DCS-BIOS exports (sends) cockpit data from Digital Combat Simulator (DCS) over a UDP socket.

DCS-BIOS only sends uint data over the socket.

  • uint data, stating the position for a switch, dial, knob
  • string data, can be frequencies 127.000 or other information from a cockpit display e.g. Waypoint : 1

Receiving

DCS-BIOS listens for commands from the user on a TCP socket. Depending on command type the syntax differs.

  • FLAPS_SWITCH INC\n This is a command to increase the position/value of FLAPS_SWITCH
  • COMPASS_BRIGHTNESS 30000\n Set the position of COMPASS_BRIGHTNESS to 30000.
  • COMPASS_BRIGHTNESS -3000\n Decrease COMPASS_BRIGHTNESS by 3000.
  • and so on, an aircraft has many different controls.

Encoding

uint data

Data is encoded so that as many controls as possible are included in the same byte.

Therefore each control has :

  • address
  • shift value
  • mask value

so that it can be read from the byte stream in the receiving end.

string data

String data starts with an address and for each character in the string increases. The data must be converted into a string in the receiving end. It is send in little endian mode.

Aircraft Lua Files

Each aircraft (airframe) has a lua file containing definitions of all the controls. These have been made by someone digging through the DCS aircraft and finding out all the proper arguments for manipulating the cockpit controls. It takes some time making mapping all these controls.

p51_lua_definitions

Aircraft JSON Files

These are auto-generated from the lua files each time a mission starts. They are used by DCS-BIOS clients who wants to read the cockpit data from the byte stream. Important informaton for the client is :

  • identifier, control name
  • control type
  • input interfaces, which differs depending of whether it is e.g. a dial or a button
  • output information

This JSON snippet corresponds to the "GEN" (Generator) definition in the above lua image. p51_gen_json_control