getVersion()
Return OpenTX version
@status current Introduced in 2.0.0, expanded in 2.1.7, radio type strings changed in 2.2.0, os name added in EdgeTX 2.4.0

Example

This example also runs in OpenTX versions where the function returned only one value:
1
local function run(event)
2
local ver, radio, maj, minor, rev, osname = getVersion()
3
print("version: "..ver)
4
if radio then print ("radio: "..radio) end
5
if maj then print ("maj: "..maj) end
6
if minor then print ("minor: "..minor) end
7
if rev then print ("rev: "..rev) end
8
if osname then print ("osname: "..osname) end
9
return 1
10
end
11
12
return { run=run }
Copied!
Output of the above script in simulator:
1
version: 2.4.0
2
radio: tx16s-simu
3
maj: 2
4
minor: 4
5
rev: 0
6
osname: EdgeTX
Copied!

Parameters

none

Return value

  • string OpenTX version (ie "2.1.5")
  • multiple values (available since 2.1.7):
    • (string) OpenTX version (ie "2.1.5")
    • (string) radio type: x12s, x10, x9e, x9d+, x9d or x7.
      If running in simulator the "-simu" is added
    • (number) major version (ie 2 if version 2.1.5)
    • (number) minor version (ie 1 if version 2.1.5)
    • (number) revision number (ie 5 if version 2.1.5)
      Since EdgeTX 2.4.0, sixth value added
    • (string) OS name (i.e. EdgeTX or nil if OpenTX)
Export as PDF
Copy link