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,
};
enum AVCLAN_ENUM_CLASS Parse : uint8_t {
TOO_SHORT = 0x01,
MISMATCH_LENGTH,
LENGTH_TOO_BIG,
};
#ifdef __cplusplus
};
#endif
+1 -1
View File
@@ -10,7 +10,7 @@
#include "frame.hpp"
namespace {
using Error = avclan::Frame::Error;
using Error = avclan::detail::Error;
using enum Error::Parse;
} // namespace
+3 -7
View File
@@ -7,6 +7,8 @@
#include <cstdint>
#include "avclan.h"
namespace avclan {
enum class Device : uint8_t;
@@ -16,13 +18,7 @@ struct Frame {
bool binary : 1 = false; // if printing, format as binary instead of text
bool verbose : 1 = false; // include extra context in error reports
};
struct Error {
enum class Parse : uint8_t {
TOO_SHORT = 0x01,
MISMATCH_LENGTH,
LENGTH_TOO_BIG,
};
};
using Error = detail::Error;
static constexpr int MAXLENGTH = 32;
Error::Parse parse(const uint8_t *bytes, uint8_t len);