fix(hw_interface): Correct the buffersize for incomming string

This commit is contained in:
2025-10-31 17:48:13 +01:00
parent bd8400027f
commit 7fbc44cd93

View File

@@ -9,9 +9,9 @@ HardwareInterface::HardwareInterface() : Node("hardware_interface") {
void HardwareInterface::read() {
char buffer[100];
char buffer[114];
RCLCPP_INFO(this->get_logger(), "Interacting with hardware...");
serial.readString(buffer, '\n', 14, 2000); // or readBytes depending on the data format ;)
serial.readString(buffer, '\n', 114, 2000); // or readBytes depending on the data format ;)
RCLCPP_INFO(this->get_logger(), "Data read from hardware: %s", buffer);
}