refactor(protocol): move wire helpers into canonical protocol module
Rehome the wire serialization helpers under protocol ownership so the module name reflects its real role instead of simulator-era naming. - rename sim/wire header to protocol/wire_codec - rename sim/wire implementation to protocol/wire_codec - keep behavior and byte layout unchanged Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#include "cvmmap_streamer/ipc/contracts.hpp"
|
||||
|
||||
namespace cvmmap_streamer::protocol::wire_codec {
|
||||
|
||||
constexpr std::size_t kSyncMessageBytes = 48;
|
||||
constexpr std::size_t kModuleStatusMessageBytes = 32;
|
||||
|
||||
void write_frame_metadata(
|
||||
std::span<std::uint8_t> metadata,
|
||||
const ipc::FrameInfo &info,
|
||||
std::uint32_t frame_count,
|
||||
std::uint64_t timestamp_ns);
|
||||
|
||||
void write_sync_message(
|
||||
std::span<std::uint8_t> out,
|
||||
std::string_view label,
|
||||
std::uint32_t frame_count,
|
||||
std::uint64_t timestamp_ns);
|
||||
|
||||
void write_module_status_message(
|
||||
std::span<std::uint8_t> out,
|
||||
std::string_view label,
|
||||
ipc::ModuleStatus status);
|
||||
|
||||
void write_deterministic_payload(
|
||||
std::span<std::uint8_t> out,
|
||||
std::uint32_t frame_count,
|
||||
std::uint16_t width,
|
||||
std::uint16_t height,
|
||||
std::uint8_t channels);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user