11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
21PROMEKI_NAMESPACE_BEGIN
73 PROMEKI_DATATYPE(Cea608Packet, DataTypeCea608, 1)
79 enum class Channel : uint8_t {
87 Channel channel = Channel::CC1;
95 Cea708Cdp::CcDataList ccData;
97 Cea608Packet() =
default;
105 Cea608Packet(Channel channel, Cea708Cdp::CcDataList ccData)
106 : channel(channel), ccData(std::move(ccData)) {}
127 static Cea608Packet fromCdp(
const Cea708Cdp &cdp, Channel channel);
143 Cea708Cdp toCdp(uint8_t frameRateCode = 0, uint16_t sequenceCounter = 0)
const;
155 JsonObject toJson()
const;
163 String toString()
const;
167 bool operator==(
const Cea608Packet &o)
const {
168 return channel == o.channel && ccData == o.ccData;
170 bool operator!=(
const Cea608Packet &o)
const {
return !(*
this == o); }
176 static String channelName(Channel c);
185 Error writeToStream(DataStream &s)
const;
191 template <u
int32_t V>
static Result<Cea608Packet> readFromStream(DataStream &s);