17 #ifndef KAASYNCREQUEST_HPP_
18 #define KAASYNCREQUEST_HPP_
25 #include <arpa/inet.h>
50 std::copy(reinterpret_cast<const std::uint8_t *>(header),
51 reinterpret_cast<const std::uint8_t *>(header + size),
54 auto messageIt = message_.begin() + size;
57 std::copy(reinterpret_cast<std::uint8_t *>(&nameLengthNetworkOrder), reinterpret_cast<std::uint8_t *>(&nameLengthNetworkOrder) + 2, messageIt);
66 std::uint16_t messageIdNetworkOrder = htons(messageId);
67 std::copy(reinterpret_cast<std::uint8_t *>(&messageIdNetworkOrder), reinterpret_cast<std::uint8_t *>(&messageIdNetworkOrder) + 2, messageIt);
70 *messageIt |= (((std::uint8_t)messageType) << 4);
81 std::copy(payload.begin(), payload.end(), messageIt);
86 const std::vector<std::uint8_t>&
getRawMessage()
const {
return message_; }
89 std::vector<std::uint8_t> message_;
91 static const std::uint8_t KAA_SYNC_MESSAGE_TYPE_SYNC = 0x01;
92 static const std::uint8_t KAA_SYNC_MESSAGE_TYPE_BOOTSTRAP = 0x02;
static const std::uint8_t KAA_SYNC_ZIPPED_BIT
KaaSyncRequest(bool zipped, bool encrypted, std::uint16_t messageId, const T &payload, KaaSyncMessageType messageType)
const std::vector< std::uint8_t > & getRawMessage() const
static const std::uint8_t KAA_SYNC_REQUEST_BIT
static const std::uint8_t KAA_SYNC_HEADER_LENGTH
static const std::uint8_t KAA_SYNC_ENCRYPTED_BIT
static const std::uint8_t PROTOCOL_VERSION
static const std::uint16_t KAA_TCP_NAME_LENGTH
static const char *const KAA_TCP_NAME
static std::uint8_t createBasicHeader(std::uint8_t messageType, std::uint32_t length, char *message)