From b9b5d71f60d992fcf06a71818bd51cd06c71d5aa Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 7 May 2019 16:32:14 +0200 Subject: [PATCH] If sensor is not found we send Lua SPORT frames to the SPORT line --- radio/src/lua/api_general.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index e38095b4e..8b214e9bc 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -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);