#ifndef _SERIALMSGHANDLER_HPP_ #define _SERIALMSGHANDLER_HPP_ #include #include #include #include #include "MsgHandler.hpp" class SerialMsgHandler : public MsgHandler { public: SerialMsgHandler(); ~SerialMsgHandler(); // 打开串口 bool OpenPort(const std::string& port, const std::string& baudrate); // 设置串口参数 bool setPortAttributes(int baudrate); private: speed_t baudrate_; // 新增:保存波特率(speed_t 类型) }; #endif // _SERIALMSGHANDLER_HPP_