15#ifndef PACKET_BUILDER_H
16#define PACKET_BUILDER_H
27 template<
typename T1,
typename T2>
28 using pairs_t = std::vector<std::pair<T1, T2>>;
50 void newPacket(
const uint8_t versionNumber,
const uint8_t appIdSource,
51 const uint8_t appIdDestination,
52 const Packet::SequenceFlags sequenceControlFlags,
53 const uint16_t sequenceControlCount);
55 void setDataFieldHeader(
const Packet::Bool8Enum ack,
const uint8_t serviceType,
56 const uint8_t serviceSubtype);
63 const uint8_t appIdDestination,
const Packet::SequenceFlags sequenceFlags,
64 const uint16_t sequenceCount);
75 const uint8_t appIdDestination,
const Packet::SequenceFlags sequenceFlags,
76 const uint16_t sequenceCount,
const uint8_t code);
88 const uint8_t appIdDestination,
const Packet::SequenceFlags sequenceFlags,
89 const uint16_t sequenceCount,
const uint8_t code,
90 const std::vector<std::byte>& parameters);
113 template <
typename T>
141 PacketExtendedHousekeeping25::GenerationMode mode,
142 const std::vector<std::byte>& parameters);
151 const pairs_t<uint8_t, T>& addressAndData) {
152 if (addressAndData.size() > 1) {
153 packet_.pushData(
static_cast<std::byte
>(addressAndData.size()));
155 for (
size_t i = 0; i < addressAndData.size(); ++i) {
156 packet_.pushData(
static_cast<std::byte
>(addressAndData[i].first));
157 packet_.pushData(
static_cast<std::byte
>(addressAndData[i].second));
Definition: packet_builder.h:25
void addCommandVerificationAppData(const uint8_t appIdSource, const uint8_t appIdDestination, const Packet::SequenceFlags sequenceFlags, const uint16_t sequenceCount)
Definition: packet_builder.cpp:32
void addCommandDistributionAppData(const std::vector< uint8_t > &addAppData)
Definition: packet_builder.cpp:73
void addHousekeepingReportAppData(uint16_t structureId, PacketExtendedHousekeeping25::GenerationMode mode, const std::vector< std::byte > ¶meters)
Housekeeping parameter report with an Structure Identifier (SID), a generation mode and then the cont...
Definition: packet_builder.cpp:91
void newPacket(const uint8_t versionNumber, const uint8_t appIdSource, const uint8_t appIdDestination, const Packet::SequenceFlags sequenceControlFlags, const uint16_t sequenceControlCount)
reset current construction with a new fresh packet
Definition: packet_builder.cpp:12
High level packet representation; does not care as much about size.
Higher level packet for housekeeping and diagnostic data service. Packet of subtypes 25 and 26....
Higher level packet for housekeeping and diagnostic data service. Basic packet that all the subtypes ...