Device: Fix getRTC response size

Some devices pad to 16-bit.
pull/64/head^2
Kyle Schwarz 2024-12-04 12:11:01 -05:00
parent 3b95b41be4
commit 38a4af8062
1 changed files with 1 additions and 1 deletions

View File

@ -1951,7 +1951,7 @@ bool Device::setRTC(const std::chrono::time_point<std::chrono::system_clock>& ti
}
auto m51msg = std::dynamic_pointer_cast<Main51Message>(generic);
if(!m51msg || m51msg->data.size() != 1) {
if(!m51msg || m51msg->data.empty() || m51msg->data.size() > 2) {
report(APIEvent::Type::MessageFormattingError, APIEvent::Severity::Error);
return false;
}