edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

Allow 2 types of telemetry protocols to run in parallel

Open raphaelcoeffic opened this issue 4 years ago • 1 comments

Whereby most of the pulses / telemetry code is actually split by module index, it seems a couple of things rely on one single global variable called telemetryProtocol:

telemetry/telemetry.cpp:uint8_t telemetryProtocol = 255;
telemetry/telemetry.h:extern uint8_t telemetryProtocol;

For example in lua/api_general.cpp:

static int luaCrossfireTelemetryPush(lua_State * L)
{
  if (telemetryProtocol != PROTOCOL_TELEMETRY_CROSSFIRE) {
    lua_pushnil(L);
    return 1;
  }

This prevents however from flexibly using 2 different protocols to be able to achieve a redundant setup (for instance 2.4GHz FrSky D16 + 900MHz Crossfire).

raphaelcoeffic avatar Oct 24 '21 17:10 raphaelcoeffic

There is also a g_model.telemetryProtocol that is used more often.

eshifri avatar Oct 24 '21 18:10 eshifri

@raphaelcoeffic this should work now in main, right? After merging the serial/pulses refactor

gagarinlg avatar Feb 26 '23 20:02 gagarinlg