diff --git a/third_party/vesc_uart/src/extra.cpp b/third_party/vesc_uart/src/extra.cpp index 8aa3766..54ece74 100644 --- a/third_party/vesc_uart/src/extra.cpp +++ b/third_party/vesc_uart/src/extra.cpp @@ -8,13 +8,18 @@ #include #include +#include + namespace { static constexpr auto serial_device = 0; auto payload_buffer = std::array{}; -auto cmd_get_values = std::uint8_t{COMM_GET_VALUES}; +// try to use COMM_GET_VALUES_SELECTIVE +// constexpr std::uint8_t rpm_bit = 1U << 7; +// auto cmd_get_values = std::uint8_t{COMM_GET_VALUES, rpm_bit, 0x00, 0x00, 0x00}; +auto cmd_get_values = std::uint8_t{COMM_GET_VALUES, 0xFF, 0xFF, 0xFF, 0xFF}; } // namespace @@ -39,6 +44,8 @@ auto read_payload(std::span buf) -> void "`buf` is not large enough to hold " "message"); + std::cout << "payload size: " << payload_size << '\n'; + const auto message = std::span{buf.data(), std::size_t(payload_size + footer_size)}; Serial.read(message);