fwt_software/include/fgc/ChannelTopics.h

28 lines
967 B
C++

#pragma once
#include "fgc/IControlChannel.h"
#include <string>
namespace fgc {
// Topic names and payload encoding for the control channel, kept here rather
// than inside MqttControlChannel so the null channel produces byte-identical
// output (its history has to show what WOULD have been sent, not an
// approximation) and so the JSON is unit-testable without a broker.
//
// Scheme: GGS/FWT/<tower>/<leaf> — see docs/mqtt-api.md.
// Leaf names, so the two channels and the UI agree on spelling.
inline constexpr const char* kTopicTargetHdg = "target_HDG";
inline constexpr const char* kTopicControlCode = "ControlCode";
inline constexpr const char* kTopicStatusCode = "StatusCode";
inline constexpr const char* kTopicCamEvent = "CamEvent";
std::string towerTopic(const std::string& tower, const std::string& leaf);
// Payload builders. One definition each, used by both channels.
std::string camEventJson(const CamEvent& e);
} // namespace fgc