From 1b932637df7d5396bb7176c033d1fd2a9f0b1fec Mon Sep 17 00:00:00 2001 From: Chi Huu Huynh <73843190+Chi-EEE@users.noreply.github.com> Date: Sun, 10 Dec 2023 13:33:54 +0000 Subject: [PATCH] Use old send_cmd --- libraries/RPLidar/src/RPLidar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/RPLidar/src/RPLidar.cpp b/libraries/RPLidar/src/RPLidar.cpp index 5ebf53ff..24726116 100644 --- a/libraries/RPLidar/src/RPLidar.cpp +++ b/libraries/RPLidar/src/RPLidar.cpp @@ -159,8 +159,12 @@ namespace rplidar { */ void RPLidar::_send_cmd(uint8_t cmd) { - uint8_t msg[] = {SYNC_BYTE, cmd}; - this->_serial->write(msg, sizeof(msg)); + std::string req; + req += static_cast(SYNC_BYTE); + req += static_cast(cmd); + + this->_serial->write(req); + spdlog::debug("Command sent: {}", spdlog::to_hex(req)); } /**