Skip to content

Commit

Permalink
chore(aeva_api): put constants and types to the top of the file
Browse files Browse the repository at this point in the history
Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex committed Nov 18, 2024
1 parent a382611 commit eed7b31
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@
namespace nebula::drivers::connections
{

static const uint16_t g_aeva_header = 0xAEFA;

enum class AevaStreamType : uint16_t {
kSphericalPointCloud = 0,
kHealth = 1,
kConfig = 2,
kTelemetry = 3,
kVelocityEstimate = 4,
kCalibration = 5,
kImage = 6,
kReconfig = 7,
kVehicleStateEstimate = 8,
kLog = 9,
kImu = 10,
kObjectList = 12,
kEstimatedDetectionRange = 33,
kUnknown = 0xFFFFu
};

using nebula::drivers::aeva::MessageHeader;
using nebula::drivers::aeva::SomeIpHeader;

class ParseError : public std::exception
{
};
Expand All @@ -58,8 +80,6 @@ class MismatchError : public ParseError
const std::string message_;
};

static const uint16_t g_aeva_header = 0xAEFA;

template <typename A, typename E>
void expect_eq(A actual, E expected, const std::string & message)
{
Expand All @@ -76,26 +96,6 @@ void expect_geq(A actual, E expected, const std::string & message)
if (cast_actual < cast_expected) throw MismatchError(message, cast_expected, cast_actual);
}

enum class AevaStreamType : uint16_t {
kSphericalPointCloud = 0,
kHealth = 1,
kConfig = 2,
kTelemetry = 3,
kVelocityEstimate = 4,
kCalibration = 5,
kImage = 6,
kReconfig = 7,
kVehicleStateEstimate = 8,
kLog = 9,
kImu = 10,
kObjectList = 12,
kEstimatedDetectionRange = 33,
kUnknown = 0xFFFFu
};

using nebula::drivers::aeva::MessageHeader;
using nebula::drivers::aeva::SomeIpHeader;

template <typename T>
T pull_and_parse(
const std::vector<uint8_t>::const_iterator & cbegin,
Expand Down

0 comments on commit eed7b31

Please sign in to comment.