Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
blob_frame.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <cstddef>
11#include <cstdint>
12#include <optional>
13#include <span>
14
15namespace checksum
16{
18constexpr size_t kFrameOverhead = 8;
19
24void frame_blob(std::span<uint8_t> blob, uint32_t magic);
25
30std::optional<std::span<const uint8_t>> unframe_blob(std::span<const uint8_t> blob, uint32_t magic);
31} // namespace checksum
constexpr size_t kFrameOverhead
Bytes the frame adds around the body: the magic in front and the CRC behind.
Definition blob_frame.h:18
void frame_blob(std::span< uint8_t > blob, uint32_t magic)
Stamps magic into the first four bytes and the CRC-32 of all but the last four bytes into the last fo...
Definition blob_frame.cpp:9
std::optional< std::span< const uint8_t > > unframe_blob(std::span< const uint8_t > blob, uint32_t magic)
Checks the magic and the CRC; returns the body (bytes 4 .. size-4), or empty if either check fails.
Definition blob_frame.cpp:20