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
blobs.h
Go to the documentation of this file.
1
9#pragma once
10
11#include "network_list.h"
12
13#include <array>
14#include <optional>
15#include <span>
16
17namespace prov
18{
19constexpr size_t kNetsBlobSize = 4 + 1 + 1 + kMaxNetworks * (kSsidMax + 1 + kPassMax + 1 + 4) + 4;
20constexpr size_t kPinBlobSize = 4 + 1 + 1 + kSaltLen + kHashLen + 4;
21
23std::array<uint8_t, kNetsBlobSize> serialize_nets(const NetworkList& list);
25std::optional<NetworkList> deserialize_nets(std::span<const uint8_t> blob);
27std::array<uint8_t, kPinBlobSize> serialize_pin(const PinRecord& rec);
29std::optional<PinRecord> deserialize_pin(std::span<const uint8_t> blob);
30} // namespace prov
std::optional< NetworkList > deserialize_nets(std::span< const uint8_t > blob)
Parses a nets blob; empty on wrong length, magic, version, CRC, count, unterminated or invalid fields...
Definition blobs.cpp:41
std::optional< PinRecord > deserialize_pin(std::span< const uint8_t > blob)
Parses a pin blob; empty on wrong length, magic, version, CRC or set byte.
Definition blobs.cpp:74
std::array< uint8_t, kNetsBlobSize > serialize_nets(const NetworkList &list)
Packs the list into the nets blob.
Definition blobs.cpp:24
std::array< uint8_t, kPinBlobSize > serialize_pin(const PinRecord &rec)
Packs the PIN record into the pin blob.
Definition blobs.cpp:63
Fixed-capacity list of saved WiFi networks with recency-based eviction (pure C++20,...