Docs added
This commit is contained in:
+23
-1
@@ -129,7 +129,29 @@ Returns OpenTX version
|
|||||||
|
|
||||||
@retval list (available since OpenTX 2.1.7) returns two values:
|
@retval list (available since OpenTX 2.1.7) returns two values:
|
||||||
* `string` OpenTX version (ie "2.1.5")
|
* `string` OpenTX version (ie "2.1.5")
|
||||||
* `string` radio version (ie "Taranis", "TaranisPlus", if running in simulator the "-simu" is added)
|
* `string` radio version: `taranisx9e`, `taranisplus` or `taranis`.
|
||||||
|
If running in simulator the "-simu" is added
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
This example also runs in OpenTX versions where the radio version was not available:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
local function run(event)
|
||||||
|
local ver, radio = getVersion()
|
||||||
|
print("version: "..ver)
|
||||||
|
if radio then print ("radio: "..radio) end
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return { run=run }
|
||||||
|
```
|
||||||
|
Output of above script in simulator:
|
||||||
|
```
|
||||||
|
version: 2.1.7
|
||||||
|
radio: taranis-simu
|
||||||
|
Script finished with status 1
|
||||||
|
```
|
||||||
*/
|
*/
|
||||||
static int luaGetVersion(lua_State *L)
|
static int luaGetVersion(lua_State *L)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user