25 lines
616 B
C
25 lines
616 B
C
|
|
typedef enum {
|
|
LAVEUSE_ARRET,
|
|
LAVEUSE_REMPLISSAGE,
|
|
LAVEUSE_LAVAGE,
|
|
LAVEUSE_RINCAGE,
|
|
LAVEUSE_ESSORAGE,
|
|
LAVEUSE_TERMINEE,
|
|
LAVEUSE_ERREUR
|
|
} WMState;
|
|
|
|
typedef struct {
|
|
WMState etat; // Indique l'état de la machine
|
|
double depuis; // timestamp de l'evenement
|
|
bool ack; // Evenement acquitté ?
|
|
} WashingMachineState;
|
|
|
|
WashingMachineState traiteMessage(char *message);
|
|
|
|
void timestampToDate(double timestamp, char* dateStr, size_t dateStrSize);
|
|
|
|
WashingMachineState getEtatMachine();
|
|
void getEtatMachineStr(WashingMachineState wms, char* etat, size_t etatSize);
|
|
void acknoledge();
|