Compare commits

...

2 Commits

Author SHA1 Message Date
Kyle Schwarz 4f83614037 Bindings: Python: Fix Device RTC functions 2024-12-04 12:31:06 -05:00
Kyle Schwarz 38a4af8062 Device: Fix getRTC response size
Some devices pad to 16-bit.
2024-12-04 12:11:01 -05:00
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/functional.h>
#include <pybind11/chrono.h>
#include "icsneo/device/device.h"

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;
}