Move Error::Parse enum into avclan.h

This commit is contained in:
Allen Hill
2026-07-08 09:41:25 -07:00
parent 1ac9a14811
commit 52b4b625fb
3 changed files with 10 additions and 8 deletions
+6
View File
@@ -151,6 +151,12 @@ struct Error {
MUTED, MUTED,
}; };
enum AVCLAN_ENUM_CLASS Parse : uint8_t {
TOO_SHORT = 0x01,
MISMATCH_LENGTH,
LENGTH_TOO_BIG,
};
#ifdef __cplusplus #ifdef __cplusplus
}; };
#endif #endif
+1 -1
View File
@@ -10,7 +10,7 @@
#include "frame.hpp" #include "frame.hpp"
namespace { namespace {
using Error = avclan::Frame::Error; using Error = avclan::detail::Error;
using enum Error::Parse; using enum Error::Parse;
} // namespace } // namespace
+3 -7
View File
@@ -7,6 +7,8 @@
#include <cstdint> #include <cstdint>
#include "avclan.h"
namespace avclan { namespace avclan {
enum class Device : uint8_t; enum class Device : uint8_t;
@@ -16,13 +18,7 @@ struct Frame {
bool binary : 1 = false; // if printing, format as binary instead of text bool binary : 1 = false; // if printing, format as binary instead of text
bool verbose : 1 = false; // include extra context in error reports bool verbose : 1 = false; // include extra context in error reports
}; };
struct Error { using Error = detail::Error;
enum class Parse : uint8_t {
TOO_SHORT = 0x01,
MISMATCH_LENGTH,
LENGTH_TOO_BIG,
};
};
static constexpr int MAXLENGTH = 32; static constexpr int MAXLENGTH = 32;
Error::Parse parse(const uint8_t *bytes, uint8_t len); Error::Parse parse(const uint8_t *bytes, uint8_t len);