Files
picomap/include/protocol.h

35 lines
929 B
C
Raw Normal View History

#pragma once
#include <cstdint>
#include <string>
#include <tuple>
#include <vector>
struct ResponsePICOBOOT {
static constexpr int8_t ext_id = 1;
auto as_tuple() const { return std::tie(); }
auto as_tuple() { return std::tie(); }
};
struct RequestPICOBOOT {
static constexpr int8_t ext_id = 2;
auto as_tuple() const { return std::tie(); }
auto as_tuple() { return std::tie(); }
};
struct DeviceError {
static constexpr int8_t ext_id = 3;
uint32_t code;
std::string message;
auto as_tuple() const { return std::tie(code, message); }
auto as_tuple() { return std::tie(code, message); }
};
struct Envelope {
static constexpr int8_t ext_id = 0;
uint32_t message_id;
uint32_t checksum;
std::vector<uint8_t> payload;
auto as_tuple() const { return std::tie(message_id, checksum, payload); }
auto as_tuple() { return std::tie(message_id, checksum, payload); }
};