#ifndef __COMUNICATION_H
#define __COMUNICATION_H

#include "stdint.h"


#define WRITETABHEU	0x00
#define	READTABHEU	0x10
#define WRITETABVAL	0x20
#define READTABVAL	0x30
#define READVENT	0x40
#define WRITVENT	0x50
#define	WRITEVALESS	0x60
#define STOP		0x70
#define ESSAI		0x80
#define SYNCRTC		0x90
#define STATUS		0xA0

#define MASKMES 0XF0
#define MASKID 0x07
#define MASKTYPE 0x08
#define MASKON 0x01


void parse(uint8_t* mes);

void Com_WriteTabHeure(uint8_t* mes);
void Com_ReadTabVal(uint8_t* mes);

void Com_WriteTabVal(uint8_t* mes);
void Com_ReadTabHeure(uint8_t* mes);

void Com_ReadVent(uint8_t* mes);
void Com_WriteVent(uint8_t* mes);

void Com_WriteValEsai(uint8_t* mes);

void Com_STOP(uint8_t* mes);
void Com_ESSAI(uint8_t* mes);

void Com_SyncRTC(uint8_t* mes);

void Com_Status();

#endif

