#ifndef _HDLC_FRAMER_H_
#define _HDLC_FRAMER_H_

#include <stdint.h>
#include <klog.h>

class cHDLC : public cKlog
{
   uint8_t mRxBuffer[1024];
   int mRxIdx;
   bool mEscaping;
   uint16_t mRxCRC;
   void reset_rx();
   static const uint8_t HDLC_FLAG;
   static const uint8_t HDLC_ESC;
   static const uint8_t HDLC_XOR;
   int stuff_byte(uint8_t data, uint8_t * buff);
public:
   cHDLC();
   virtual void frameData(uint8_t *msg, int msg_len, uint8_t *tx_data, int *tx_len);
   virtual bool unFrameByte(uint8_t data, uint8_t *msg, int *msg_len);
   void reset();
};
#endif //Include Guard
