update movement set

This commit is contained in:
superkor
2026-01-27 22:17:44 -05:00
committed by Johnathon Slightham
parent 3c6f8b2c86
commit c6bcff20c3
9 changed files with 278 additions and 92 deletions

View File

@@ -11,14 +11,22 @@
#include "flatbuffers_generated/Movement_generated.h"
#include "flatbuffers/flatbuffers.h"
struct MovementEntryInput {
uint16_t board_id;
uint8_t module_type;
uint16_t value_action;
Movement::ConditionBlob condition;
uint8_t ack;
uint16_t ack_ttl_ms;
uint16_t post_delay_ms;
};
namespace Flatbuffers {
class MovementSetBuilder {
public:
MovementSetBuilder() : builder_(MAX_MOVEMENTS_IN_SET*sizeof(Movement::MovementEntry)) {}
SerializedMessage build_movement_set(const std::vector<flatbuffers::Offset<Movement::MovementEntry>>& set);
flatbuffers::Offset<Movement::MovementEntry> build_movement_entry(uint16_t board_id, uint8_t module_type, uint16_t value_action,
const Movement::ConditionBlob& condition, uint8_t ack, uint16_t ack_ttl_ms, uint16_t post_delay_ms);
SerializedMessage build_movement_set(const std::unordered_map<uint8_t, std::vector<MovementEntryInput>>& input);
Movement::ConditionBlob build_condition_blob(uint16_t value, uint8_t cond, uint8_t module_type, uint8_t in_use);
private: