11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
21PROMEKI_NAMESPACE_BEGIN
70 PROMEKI_DATATYPE(Cea608Packet, DataTypeCea608, 1)
76 enum class Channel : uint8_t {
84 Channel channel = Channel::CC1;
92 Cea708Cdp::CcDataList ccData;
94 Cea608Packet() =
default;
102 Cea608Packet(Channel channel, Cea708Cdp::CcDataList ccData)
103 : channel(channel), ccData(std::move(ccData)) {}
124 static Cea608Packet fromCdp(
const Cea708Cdp &cdp, Channel channel);
140 Cea708Cdp toCdp(uint8_t frameRateCode = 0, uint16_t sequenceCounter = 0)
const;
152 JsonObject toJson()
const;
160 String toString()
const;
164 bool operator==(
const Cea608Packet &o)
const {
165 return channel == o.channel && ccData == o.ccData;
167 bool operator!=(
const Cea608Packet &o)
const {
return !(*
this == o); }
173 static String channelName(Channel c);
182 Error writeToStream(DataStream &s)
const;
188 template <u
int32_t V>
static Result<Cea608Packet> readFromStream(DataStream &s);