CFDP SOURCE handler #157
@ -1,6 +1,7 @@
|
||||
#include "PutRequest.h"
|
||||
|
||||
using namespace returnvalue;
|
||||
|
||||
[[nodiscard]] bool cfdp::PutRequest::isMetadataOnly() const {
|
||||
return destNameSize > 0 and sourceNameSize > 0;
|
||||
}
|
||||
@ -35,6 +36,9 @@ ReturnValue_t cfdp::PutRequest::serialize(uint8_t **buffer, size_t *size, size_t
|
||||
if (result != OK) {
|
||||
return result;
|
||||
}
|
||||
if (*size + destNameSize > maxSize) {
|
||||
return SerializeIF::BUFFER_TOO_SHORT;
|
||||
}
|
||||
std::memcpy(*buffer, destName, destNameSize);
|
||||
*buffer += destNameSize;
|
||||
*size += destNameSize;
|
||||
@ -49,11 +53,42 @@ ReturnValue_t cfdp::PutRequest::serialize(uint8_t **buffer, size_t *size, size_t
|
||||
*buffer += 1;
|
||||
}
|
||||
}
|
||||
result =
|
||||
SerializeAdapter::serialize(&msgsToUsersTotalSize, buffer, size, maxSize, streamEndianness);
|
||||
if (result != OK) {
|
||||
return result;
|
||||
}
|
||||
result = SerializeAdapter::serialize(&numOfMsgsToUser, buffer, size, maxSize, streamEndianness);
|
||||
if (result != OK) {
|
||||
return result;
|
||||
}
|
||||
if (*size + msgsToUsersTotalSize > maxSize) {
|
||||
return SerializeIF::BUFFER_TOO_SHORT;
|
||||
}
|
||||
std::memcpy(*buffer, messagesToUserStartPtr, msgsToUsersTotalSize);
|
||||
*buffer += msgsToUsersTotalSize;
|
||||
*size += msgsToUsersTotalSize;
|
||||
|
||||
return returnvalue::OK;
|
||||
result =
|
||||
SerializeAdapter::serialize(&fsRequestsTotalSize, buffer, size, maxSize, streamEndianness);
|
||||
if (result != OK) {
|
||||
return result;
|
||||
}
|
||||
result = SerializeAdapter::serialize(&numOfFsRequests, buffer, size, maxSize, streamEndianness);
|
||||
if (result != OK) {
|
||||
return result;
|
||||
}
|
||||
if (*size + fsRequestsTotalSize > maxSize) {
|
||||
return SerializeIF::BUFFER_TOO_SHORT;
|
||||
}
|
||||
std::memcpy(*buffer, fsRequest, fsRequestsTotalSize);
|
||||
*buffer += fsRequestsTotalSize;
|
||||
*size += fsRequestsTotalSize;
|
||||
return OK;
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::PutRequest::deSerialize(const uint8_t **buffer, size_t *size,
|
||||
SerializeIF::Endianness streamEndianness) {
|
||||
return returnvalue::OK;
|
||||
return OK;
|
||||
}
|
||||
size_t cfdp::PutRequest::getSerializedSize() const { return 0; }
|
||||
|
Loading…
Reference in New Issue
Block a user