implement relative timeshift #173

Merged
muellerr merged 10 commits from time-service-relative-timeshift into develop 2024-04-09 13:31:13 +02:00
Showing only changes of commit f8e3777c43 - Show all commits

View File

@ -27,9 +27,7 @@ ReturnValue_t Service9TimeManagement::handleRequest(uint8_t subservice) {
if (result != returnvalue::OK) {
return result;
}
uint32_t subsecondMs =
static_cast<uint32_t>(std::floor(static_cast<double>(newTime.tv_usec) / 1000.0));
triggerEvent(CLOCK_DUMP, newTime.tv_sec, subsecondMs);
triggerEvent(CLOCK_DUMP, newTime.tv_sec, newTime.tv_usec);
muellerr marked this conversation as resolved Outdated

either still dump milliseconds for P2 or change the description of the event

either still dump milliseconds for P2 or change the description of the event
return returnvalue::OK;
}
case Subservice::RELATIVE_TIMESHIFT: {
@ -63,7 +61,12 @@ ReturnValue_t Service9TimeManagement::handleRequest(uint8_t subservice) {
} else {
newTime = currentTime - offset;
}
return Clock::setClock(&newTime);
result = Clock::setClock(&newTime);
if (result == returnvalue::OK) {
// Report new time as event.
triggerEvent(CLOCK_DUMP, newTime.tv_sec, newTime.tv_usec);
muellerr marked this conversation as resolved Outdated

see above

see above
}
return result;

the same here

the same here
}
default:
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;