#ifndef MAINTASK_H_
#define MAINTASK_H_

// dlzka fronty pre Main task
	#define LENGHTQUEUEMAINTASK				5		// dlzka fronty
	
// definicie tipu spravy
	#define C_QUEUE_NEW_PACKET				1		// sprava z com_rs485 tasku s novim packetom
	#define C_QUEUE_SM_CONFIG				2		// Sprava uloz nastavenia do spinacieho modulu mozem bit aktual alebo eeprom
	#define C_QUEUE_SM_SET					3		// Pouzije zvolene nastavenie z eeprom	
	#define	C_QUEUE_ANSWER_PACKET			4		// packet je odpoved na niaky moj dotaz
	#define C_QUEUE_READ_ACT_SETT_SM		5		// ziadost o nacitanie aktalnych nastaveni z modulov
		
	#define C_QUEUE_LEDM_CONFIG				13		// Sprava uloz nastavenia do spinacieho modulu mozem bit aktual alebo eeprom
	#define C_QUEUE_LEDM_SET				14
	
	#define C_QUEUE_READ_ACT_SETT_LEDM		15		// ziadost o nacitanie aktalnych nastaveni z LED modulu
	
// definicia strukrury pre frontu 
	typedef	struct{
		unsigned char	Mesage_ID;
		char	Data[MAX_PACKET_LENGHT];
	}t_MainQueueStruct;

//******************* Funkcie **********************************************************
void	MainTask( void *pvParameters );
void 	vTimerScanConnectDevice( xTimerHandle pxTimer );
unsigned long	MainTaskInit( void );	
unsigned long	IsSPModulonline(void);
unsigned long	IsLEDModulonline(void);
unsigned long	sendToMainQueue( const t_MainQueueStruct *mesage, unsigned long xTicksToWait );
void			SendMesageToRS485( unsigned char MesageTyp, unsigned char DestID, unsigned char SourceID, unsigned char Comand, unsigned char Sign, unsigned char DataLenght, char *Data );

#endif /*MAINTASK_H_*/
