30 lines
1.0 KiB
C++
30 lines
1.0 KiB
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";
|
|
inline constexpr const char* kTopicEnv = "Env";
|
|
|
|
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);
|
|
std::string envJson(const EnvEvent& e);
|
|
|
|
} // namespace fgc
|