40 int main(
int argc,
const char* argv[])
42 std::string serial_device_name =
"/dev/ttyUSB1";
45 new Serial(serial_device_name.c_str(),
SerialFlags(SerialFlags::BR_921600, SerialFlags::DB_8));
46 serial_device->
open();
51 if (serial_device->
read(&data,
sizeof(uint8_t)))
53 std::cout <<
"0x" << std::setw(2) << std::setfill(
'0') << std::hex << static_cast<int>(data)
58 std::cout <<
"." << std::flush;
62 serial_device->
close();
ssize_t read(void *data, ssize_t size, unsigned long time=100, bool return_on_less_data=true)
Contains a class that enables access to serial devices.
int main(int argc, const char *argv[])
Enables acces to serial devices.
bool open(const SerialFlags &flags)
Short description of tSerialFlags.