1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 12:25:12 +03:00

If sensor is not found we send Lua SPORT frames to the SPORT line

This commit is contained in:
Bertrand Songis 2019-05-07 16:32:14 +02:00
parent 0d1945ae21
commit b9b5d71f60

View file

@ -454,6 +454,19 @@ static int luaSportTelemetryPush(lua_State * L)
return 1;
}
}
// sensor not found, we send the frame to the SPORT line
{
SportTelemetryPacket packet;
packet.physicalId = getDataId(luaL_checkunsigned(L, 1));
packet.primId = luaL_checkunsigned(L, 2);
packet.dataId = dataId;
packet.value = luaL_checkunsigned(L, 4);
outputTelemetryBuffer.pushSportPacketWithBytestuffing(packet);
outputTelemetryBuffer.setDestination(TELEMETRY_ENDPOINT_SPORT);
lua_pushboolean(L, true);
return 1;
}
}
lua_pushboolean(L, false);