#ifndef __COMUNICATION_H
#define __COMUNICATION_H

#include "stdint.h"
#include <FIFO_COM.h>



#define WRITETABHEU	0x00
#define WRITETABVAL	0x10
#define READVENT	0x30
#define WRITVENT	0x40
//#define ERRORCOM	0x50
#define	WRITEVALESS	0x60
#define STOP		0x70
#define ESSAI		0x80
#define SYNCRTC		0x90

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


uint8_t parse(uint8_t* mes);

void Sync();
/*
 * fonction qui lit le message dans la fifo en fonction de ca taille (lecture du premiere element).
 */
void ReadMes(FIFO_COM *f,uint8_t* mes);

void Com_WriteTabHeure(uint8_t* mes);

void Com_WriteTabVal(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);

#endif

