diff --git a/src/Services/TimeBasedCommandSchedulingService.cpp b/src/Services/TimeBasedCommandSchedulingService.cpp index 1fa26ca12e1b112f197ae646548a639833665592..ca74ef9b77dd9706a0ddbb137a5b8982c15b91a5 100644 --- a/src/Services/TimeBasedCommandSchedulingService.cpp +++ b/src/Services/TimeBasedCommandSchedulingService.cpp @@ -65,5 +65,45 @@ void TimeBasedCommandSchedulingService::insertActivities(Message &request) { } +void TimeBasedCommandSchedulingService::timeShiftAllActivities(Message &request) { + + // Check if the correct packet is being processed + assert(request.serviceType == 11); + assert(request.messageType == 5); + + uint16_t iterationCount = request.readUint16(); // Get the iteration count, (N) + for (std::size_t i = 0; i < iterationCount; i++) { + uint32_t relativeOffset = request.readUint32(); + // todo: define the enumeration types for the source ID and application process ID + uint16_t receivedSequenceCount = request.readUint16(); // Get the sequence count + /* + * Perform a search in the vector containing the activity definitions to find a match for + * the received parameters + */ + } +} + +void TimeBasedCommandSchedulingService::timeShiftActivitiesByID(Message &request) { + + // Check if the correct packet is being processed + assert(request.serviceType == 11); + assert(request.messageType == 5); + + uint32_t relativeOffset = request.readUint32(); // Get the offset first + /* + * Search for the earliest activity in the schedule. If the release time of the earliest + * activity + relativeOffset is earlier than current_time + time_margin, reject the request + * and generate a failed start of execution. + */ + uint16_t iterationCount = request.readUint16(); // Get the iteration count, (N) + for (std::size_t i = 0; i < iterationCount; i++) { + // todo: define the enumeration types for the source ID and application process ID + uint16_t receivedSequenceCount = request.readUint16(); // Get the sequence count + /* + * Perform a search in the vector containing the activity definitions to find a match for + * the received parameters + */ + } +}