123

Dependencies:   mbed

Fork of LG by igor Apu

DeviceUserProtocolEncoder.h

Committer:
Diletant
Date:
2016-05-15
Revision:
161:efd949e8d536
Child:
167:bedc0a9d559a

File content as of revision 161:efd949e8d536:

#ifndef __DEVICE_USER_PROTOCOL_ENCODER_H__
#define __DEVICE_USER_PROTOCOL_ENCODER_H__

//Response encoding state
typedef struct _DeviceUserProtocolEncoder {
  uint8_t error; //Encode error encountered
  uint8_t count; //Encoded bytes count
  uint16_t CRC;  //Current/final CRC of encoded packet
} DeviceUserProtocolEncoder;

void InitUserProtocolEncoder(void);

//Encoder elementary functions
void Encode8(uint8_t);
void Encode16(uint16_t);

//Encoder common functions
void EncodeStart(void);
void EncodeEnd(void);
void EncodeFail(void);
void EncodeAddress(void);
void EncodeMessage(void);
void EncodeParameters(void);
void EncodeCRC(void);

//Encoder specific functions
void EncodeDeviceMode(void);
void EncodeSysRgR(void);

void EncodeBINSDiff(void);
void EncodeValidBINS(void);

#endif  /* __DEVICE_USER_PROTOCOL_ENCODER_H__ */