From 945ebc214622f87c356884b34106f975ff1efc5b Mon Sep 17 00:00:00 2001 From: Vincent Hamp Date: Sun, 9 Jul 2023 12:57:58 +0200 Subject: [PATCH] Move packet up one namespace level --- README.md | 2 +- include/mdu/{rx => }/packet.hpp | 15 +++++++-------- include/mdu/rx/firmware_base.hpp | 2 +- include/mdu/rx/mixin.hpp | 2 +- include/mdu/rx/zpp_base.hpp | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) rename include/mdu/{rx => }/packet.hpp (78%) diff --git a/README.md b/README.md index d623ad9..807b138 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Activation of the MDU protocol is accomplished through a sequence of commands to | CV106 == 0x00 | CV106 == 0x00 | ### Alternative entry -As an alternative to entry via DCC CV verify commands, MDU commands with [default bit timings](#bit-timings) can be sent directly after switching on the track voltage. It is recommended to send out the shortest command, [Busy](#busy), for at least 20ms. +As an alternative to entry via DCC CV verify commands, MDU commands with [default bit timings](#bit-timings) can be sent directly after switching on the track voltage. It is recommended to send out the shortest command, [Busy](#busy), for at least 200ms. ### Transmission Bit transmission takes place MSB-first similar to the DCC protocol described in [RCN-210](http://normen.railcommunity.de/RCN-210.pdf) through zero crossings (change of polarity) of the track signal. In contrast to DCC, the transmission of a bit does not require two, but only one zero crossing. The decision as to whether a received bit represents a zero bit, one bit or acknowledgment bit is determined by the time interval between the zero crossings. This time interval has a default value at the beginning, but can be varied using a separate command (see [Config-Transfer-Rate command](#config-transfer-rate)). In addition, there are so-called fallback timings that must be able to be received at any time. diff --git a/include/mdu/rx/packet.hpp b/include/mdu/packet.hpp similarity index 78% rename from include/mdu/rx/packet.hpp rename to include/mdu/packet.hpp index e059dfc..984cf89 100644 --- a/include/mdu/rx/packet.hpp +++ b/include/mdu/packet.hpp @@ -2,9 +2,9 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -/// Receive packet +/// Packet /// -/// \file mdu/rx/packet.hpp +/// \file mdu/packet.hpp /// \author Vincent Hamp /// \date 12/12/2022 @@ -13,13 +13,12 @@ #include #include #include -#include "../command.hpp" -#include "../crc32.hpp" -#include "../utility.hpp" +#include "command.hpp" +#include "crc32.hpp" +#include "utility.hpp" -namespace mdu::rx { +namespace mdu { -/// Receive packet struct Packet { std::array @@ -35,4 +34,4 @@ constexpr Command packet2command(Packet const& packet) { return static_cast(data2uint32(cbegin(packet.data))); } -} // namespace mdu::rx \ No newline at end of file +} // namespace mdu \ No newline at end of file diff --git a/include/mdu/rx/firmware_base.hpp b/include/mdu/rx/firmware_base.hpp index 81c26ec..7ad67fa 100644 --- a/include/mdu/rx/firmware_base.hpp +++ b/include/mdu/rx/firmware_base.hpp @@ -15,8 +15,8 @@ #include #include "../command.hpp" #include "../crc32.hpp" +#include "../packet.hpp" #include "base.hpp" -#include "packet.hpp" extern "C" { #include diff --git a/include/mdu/rx/mixin.hpp b/include/mdu/rx/mixin.hpp index 411e580..ae8c162 100644 --- a/include/mdu/rx/mixin.hpp +++ b/include/mdu/rx/mixin.hpp @@ -12,7 +12,7 @@ #include #include "../command.hpp" -#include "packet.hpp" +#include "../packet.hpp" namespace mdu::rx::detail { diff --git a/include/mdu/rx/zpp_base.hpp b/include/mdu/rx/zpp_base.hpp index fca6597..b7ff750 100644 --- a/include/mdu/rx/zpp_base.hpp +++ b/include/mdu/rx/zpp_base.hpp @@ -15,8 +15,8 @@ #include #include #include "../command.hpp" +#include "../packet.hpp" #include "base.hpp" -#include "packet.hpp" namespace mdu::rx {