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

unsigned char LastRQ;

void Guard_regRQ(unsigned char rq){
	LastRQ = rq;
}

void Guard_regERR(unsigned char rq, unsigned char errcode){
	if(LastRQ == rq){
		syslog(LOG_MAKEPRI(LOG_USER, LOG_ERR),"EXTBOARD ERROR Command %X errno %X",rq,errcode);	
	}
	else
		syslog(LOG_MAKEPRI(LOG_USER, LOG_ERR),"COMMGUARD Unknown error ! ");

}

void Guard_regACK(unsigned char rq){
	if(LastRQ!=rq)
		syslog(LOG_MAKEPRI(LOG_USER, LOG_ERR),"COMMGUARD Unknown ACK error ! ");
	else
		LastRQ=0;

}

