This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#ifndef _SERIALMSGHANDLER_HPP_
#define _SERIALMSGHANDLER_HPP_
#include <string>
#include <cstdint>
#include <iostream>
#include <termios.h>
#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_