123
Fork of LG by
Diff: DeviceUserProtocolEncoder.h
- Revision:
- 161:efd949e8d536
- Child:
- 167:bedc0a9d559a
diff -r 6170df6f5a5c -r efd949e8d536 DeviceUserProtocolEncoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DeviceUserProtocolEncoder.h Sun May 15 19:12:12 2016 +0000 @@ -0,0 +1,33 @@ +#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__ */ \ No newline at end of file