#ifndef PROTOM2M_H_
#define PROTOM2M_H_

#include "gvalue.h"
#include "gType.h"

extern "C"{
	#include "uart_key_drv.h"
	#include "uart_linkage_drv.h"
	#include "user_eeprom.h"
}

class TProtoM2M{
	public:
		static unsigned char sList[dNETWORK_MACHINE_MASTER_COUNT];
		static unsigned char sCnt;
		static unsigned char sInitiator;
		static unsigned char sRecPiece;
	public:
		TProtoM2M(){};
		void Init(){
			for(int i=0; i<dNETWORK_MACHINE_MASTER_COUNT; i++)sList[i] =0;
			sCnt =0;
			sInitiator =0;
			sRecPiece = 0;
		}
		static void sInit(){
			for(int i=0; i<dNETWORK_MACHINE_MASTER_COUNT; i++)sList[i] =0;
			sCnt =0;
			sInitiator =0;
			sRecPiece = 0;
		}
		void ReInit(){Init();}
		static void sDelayMs(unsigned int aMs){
			volatile unsigned int mTick;
			volatile unsigned int Tick;
			for(Tick=0; Tick<aMs; Tick++){
				for(mTick=0; mTick<160000; mTick++);
				sys_error_led_task();
			}
		}
};

#endif

