feat: S.Port telemetry for PPM/SBUS external module (#5689)

Co-authored-by: Michael <mha1@users.noreply.github.com>
This commit is contained in:
Raphael Coeffic
2024-12-12 11:19:34 +10:00
committed by GitHub
co-authored by Michael
parent 3d1e7a914f
commit 6d17448be5
18 changed files with 171 additions and 28 deletions
@@ -109,7 +109,13 @@ static const YamlLookupTable r9mLut = {
static const YamlLookupTable ppmLut = {
{ 0, "NOTLM" },
{ 1, "MLINK" }
{ 1, "MLINK" },
{ 2, "SPort"}
};
static const YamlLookupTable sbusLut = {
{ 0, "NOTLM" },
{ 1, "SPort"}
};
static const YamlLookupTable dsmLut = {
@@ -175,6 +181,9 @@ Node convert<ModuleData>::encode(const ModuleData& rhs)
case PULSES_PPM:
node["subType"] = LookupValue(ppmLut, subtype);
break;
case PULSES_SBUS:
node["subType"] = LookupValue(sbusLut, subtype);
break;
case PULSES_MULTIMODULE: {
int rfProtocol = rhs.multi.rfProtocol + 1;
int subType = rhs.subType;
@@ -317,6 +326,9 @@ bool convert<ModuleData>::decode(const Node& node, ModuleData& rhs)
case PULSES_PPM: {
subType >> ppmLut >> rhs.subType;
} break;
case PULSES_SBUS: {
subType >> sbusLut >> rhs.subType;
} break;
case PULSES_LP45: {
int subProto = 0;
subType >> dsmLut >> subProto;