22 #ifndef SERIAL_PORT_HANDLER_H 23 #define SERIAL_PORT_HANDLER_H 29 #include <boost/asio.hpp> 40 SerialPortHandler(
const std::string &a_SerialPortName, std::shared_ptr<SerialPortHandlerCollection> a_SerialPortHandlerCollection, boost::asio::io_service& a_IOService);
58 void DeliverBufferToClients(
E_BUFFER_TYPE a_eBufferType,
const std::vector<unsigned char> &a_Payload,
bool a_bReliable,
bool a_bInvalid,
bool a_bWasSent);
59 bool OpenSerialPort();
60 void ChangeBaudRate();
61 void TransmitHDLCFrame(
const std::vector<unsigned char> &a_Payload);
62 void QueryForPayload(
bool a_bQueryReliable,
bool a_bQueryUnreliable);
67 void ForEachHdlcdServerHandler(std::function<
void(std::shared_ptr<HdlcdServerHandler>)> a_Function);
71 boost::asio::serial_port m_SerialPort;
72 boost::asio::io_service &m_IOService;
73 std::shared_ptr<ProtocolState> m_ProtocolState;
74 std::string m_SerialPortName;
75 std::weak_ptr<SerialPortHandlerCollection> m_SerialPortHandlerCollection;
76 std::list<std::weak_ptr<HdlcdServerHandler>> m_HdlcdServerHandlerList;
77 enum { max_length = 1024 };
78 unsigned char m_ReadBuffer[max_length];
80 std::vector<unsigned char> m_SendBuffer;
81 size_t m_SendBufferOffset;
89 #endif // SERIAL_PORT_HANDLER_H
This file contains the header declaration of class BaudRate.
SerialPortHandler(const std::string &a_SerialPortName, std::shared_ptr< SerialPortHandlerCollection > a_SerialPortHandlerCollection, boost::asio::io_service &a_IOService)
void DeliverPayloadToHDLC(const std::vector< unsigned char > &a_Payload, bool a_bReliable)
The HDLC Deamon implements the HDLC protocol to easily talk to devices connected via serial communica...
void AddHdlcdServerHandler(std::shared_ptr< HdlcdServerHandler > a_HdlcdServerHandler)
Copyright (c) 2016, Florian Evers, florian-evers@gmx.de All rights reserved.
void PropagateSerialPortState()