Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1

THEMA: Parameters with LUA Script

Parameters with LUA Script 15 Mai 2018 11:27 #1

  • ThomasMiric
  • ThomasMirics Avatar Autor
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Beiträge: 18
  • Dank erhalten: 8
Hello Jeti Team!

I would like to have a chance to send or receive data with LUA Script.
Specifically, it is about the possibility for Betaflight / Cleanflight / INav to change the parameters for the PIDs or the transmission frequency of the VTX.

Here's an example of what it might look like:

Request a parameter:

LUA: getDeviceParamter(<serialNumber>, <parameterID>)

Parameters
  • serialNumber - to select the device
  • parameterID - to select the parameter

Return value
  • (interger) - value of the parameter

Packet example - Master
0x3D 0x01 0x0B 0xAA 0x3C 0x03 0xBF 0xCF 0x00 0x45 0x54

0x3D 0x01 - Packet header with a permission to answer
0x0B - Message length (11)
0xAA - Packet ID
0x3C - Data identifier - request for LUA parameter
0x03 - Length of the Data
0xBF 0xCF - Serialnumber
0x00 - Parameter ID
0x5445 - CRC16-CCITT


Send a parameter:

LUA: setDeviceParameter(<serialNumber>, <parameterID>, <value>)

Parameters
  • serialNumber - to select the device
  • parameterID - to select the parameter
  • value - value of the parameter (integer)

Packet example - Slave
0x3B 0x01 0x0F 0x55 0x3C 0x03 0xBF 0xCF 0x00 0x12 0x34 0x45 0x67 0x10 0xCB

0x3B 0x01 - Packet header
0x0F - Message length (15)
0x55 - Packet ID
0x3C - Data identifier - LUA parameter
0x07 - Length of the Data
0xBF 0xCF - Serialnumber
0x00 - Parameter ID
0x11 - integer 32
0x23
0x45
0x67
0xCB10 - CRC16-CCITT

I would be happy if a solution could be found.

Thank you in advance,
Thomas

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Seite:
  • 1
Ladezeit der Seite: 0.232 Sekunden
Powered by Kunena Forum