24 #ifndef HDLCD_CLIENT_DESTROYED_H 25 #define HDLCD_CLIENT_DESTROYED_H 34 l_HdlcdClientDestroyed.m_SerialPortNbr = a_SerialPortNbr;
35 return l_HdlcdClientDestroyed;
40 l_HdlcdClientDestroyed->m_eDeserialize = DESERIALIZE_BODY;
41 l_HdlcdClientDestroyed->m_BytesRemaining = 3;
42 return l_HdlcdClientDestroyed;
47 assert(m_eDeserialize == DESERIALIZE_FULL);
48 return m_SerialPortNbr;
60 const std::vector<unsigned char> Serialize()
const {
61 assert(m_eDeserialize == DESERIALIZE_FULL);
62 std::vector<unsigned char> l_Buffer;
64 l_Buffer.emplace_back((m_SerialPortNbr >> 8) & 0xFF);
65 l_Buffer.emplace_back((m_SerialPortNbr >> 0) & 0xFF);
72 switch (m_eDeserialize) {
73 case DESERIALIZE_BODY: {
77 m_SerialPortNbr = ntohs(*(reinterpret_cast<const uint16_t*>(&
m_Buffer[1])));
78 m_eDeserialize = DESERIALIZE_FULL;
81 case DESERIALIZE_ERROR:
82 case DESERIALIZE_FULL:
92 uint16_t m_SerialPortNbr;
94 DESERIALIZE_ERROR = 0,
98 E_DESERIALIZE m_eDeserialize;
101 #endif // HDLCD_CLIENT_DESTROYED_H static HdlcdClientDestroyed Create(uint16_t a_SerialPortNbr)
uint16_t GetSerialPortNbr() const
static std::shared_ptr< HdlcdClientDestroyed > CreateDeserializedFrame()
std::vector< unsigned char > m_Buffer
The buffer containing partly received frames or higher-layer payload.