more fixes

This commit is contained in:
Robin Müller 2024-04-03 16:23:21 +02:00
parent 0e2fa8dc83
commit f8e3777c43
Signed by: muellerr
GPG Key ID: A649FB78196E3849

View File

@ -27,9 +27,7 @@ ReturnValue_t Service9TimeManagement::handleRequest(uint8_t subservice) {
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
uint32_t subsecondMs = triggerEvent(CLOCK_DUMP, newTime.tv_sec, newTime.tv_usec);
static_cast<uint32_t>(std::floor(static_cast<double>(newTime.tv_usec) / 1000.0));
triggerEvent(CLOCK_DUMP, newTime.tv_sec, subsecondMs);
return returnvalue::OK; return returnvalue::OK;
} }
case Subservice::RELATIVE_TIMESHIFT: { case Subservice::RELATIVE_TIMESHIFT: {
@ -63,7 +61,12 @@ ReturnValue_t Service9TimeManagement::handleRequest(uint8_t subservice) {
} else { } else {
newTime = currentTime - offset; 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);
}
return result;
} }
default: default:
return AcceptsTelecommandsIF::INVALID_SUBSERVICE; return AcceptsTelecommandsIF::INVALID_SUBSERVICE;