[Decoder] Added protocol: Analog

Dieser Commit ist enthalten in:
Reinder Feenstra 2026-01-09 23:25:12 +01:00
Ursprung db19f52a9e
Commit a1ded854cc
3 geänderte Dateien mit 18 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -1,9 +1,8 @@
/**
* server/src/hardware/decoder/decodercontroller.cpp
* This file is part of Traintastic,
* see <https://github.com/traintastic/traintastic>.
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2021-2023,2025 Reinder Feenstra
* Copyright (C) 2021-2026 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -58,6 +57,7 @@ std::pair<uint16_t, uint16_t> DecoderController::decoderAddressMinMax(DecoderPro
return {1, 112};
case DecoderProtocol::MFX: // no address -> MFX UID is used
case DecoderProtocol::Analog:
case DecoderProtocol::None:
return noAddressMinMax;
}
@ -89,6 +89,9 @@ std::span<const uint8_t> DecoderController::decoderSpeedSteps(DecoderProtocol pr
case DecoderProtocol::None:
return {};
case DecoderProtocol::Analog:
break; // must be handle by interface
}
assert(false);
return {};

Datei anzeigen

@ -1,9 +1,8 @@
/**
* server/src/hardware/protocol/marklincan/kernel.cpp
* This file is part of Traintastic,
* see <https://github.com/traintastic/traintastic>.
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2023-2025 Reinder Feenstra
* Copyright (C) 2023-2026 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -611,8 +610,7 @@ void Kernel::decoderChanged(const Decoder& decoder, DecoderChangeFlags changes,
}
break;
case DecoderProtocol::None:
case DecoderProtocol::Selectrix:
default: [[unlikely]]
assert(false);
break;
}

Datei anzeigen

@ -1,9 +1,8 @@
/**
* shared/src/enum/decoderprotocol.hpp
* This file is part of Traintastic,
* see <https://github.com/traintastic/traintastic>.
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2019-2023 Reinder Feenstra
* Copyright (C) 2019-2026 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -35,9 +34,10 @@ enum class DecoderProtocol : uint8_t
Selectrix = 4,
//FMZ = 5,
DCCLong = 6,
Analog = 7,
};
TRAINTASTIC_ENUM(DecoderProtocol, "decoder_protocol", 6,
TRAINTASTIC_ENUM(DecoderProtocol, "decoder_protocol", 7,
{
{DecoderProtocol::None, "none"},
{DecoderProtocol::DCCShort, "dcc_short"},
@ -45,6 +45,7 @@ TRAINTASTIC_ENUM(DecoderProtocol, "decoder_protocol", 6,
{DecoderProtocol::MFX, "mfx"},
{DecoderProtocol::Selectrix, "selectrix"},
{DecoderProtocol::DCCLong, "dcc_long"},
{DecoderProtocol::Analog, "analog"},
});
constexpr bool hasAddress(DecoderProtocol value)
@ -59,6 +60,7 @@ constexpr bool hasAddress(DecoderProtocol value)
case DecoderProtocol::None:
case DecoderProtocol::MFX:
case DecoderProtocol::Analog:
return false;
}
return false;