Radiosonde RX now understands Meteomodem's M10 correctly

Updated binary
This commit is contained in:
furrtek 2017-10-27 18:54:50 +02:00
parent 6e7b2c751f
commit d47f292d3a
11 changed files with 157 additions and 47 deletions

View file

@ -34,25 +34,39 @@ struct DecodedSymbol {
uint_fast8_t error;
};
class ManchesterDecoder {
class ManchesterBase {
public:
constexpr ManchesterDecoder(
constexpr ManchesterBase(
const baseband::Packet& packet,
const size_t sense = 0
) : packet { packet },
sense { sense }
{
}
virtual DecodedSymbol operator[](const size_t index) const = 0;
DecodedSymbol operator[](const size_t index) const;
size_t symbols_count() const;
private:
virtual size_t symbols_count() const;
virtual ~ManchesterBase() { };
protected:
const baseband::Packet& packet;
const size_t sense;
};
class ManchesterDecoder : public ManchesterBase {
public:
using ManchesterBase::ManchesterBase;
DecodedSymbol operator[](const size_t index) const;
};
class BiphaseMDecoder : public ManchesterBase {
public:
using ManchesterBase::ManchesterBase;
DecodedSymbol operator[](const size_t index) const;
};
template<typename T>
T operator|(const T& l, const DecodedSymbol& r) {
return l | r.value;
@ -64,7 +78,7 @@ struct FormattedSymbols {
};
FormattedSymbols format_symbols(
const ManchesterDecoder& decoder
const ManchesterBase& decoder
);
void manchester_encode(uint8_t * dest, uint8_t * src, const size_t length, const size_t sense = 0);