//************************************************************************************
// 	 This software simulated ARPEES protocol for Wireless Sensor Network             *
//	 Copyright (C) 2007 by Tran Quang Vinh (vinhtq@mail.hut.edu.vn)                  *
//	 Multimedia Information NETwork Lab - MINET                                      *
//	 Dept. Electronic Information Systems, Graduate School of Enginnering            *
//	 Shibaura Institute of Technology, Japan.                                        *
//-----------------------------------------------------------------------------------*
//	 File name: MessageType.msg				                                         *
//	 the method of OMNET++ to implement the messages in the protocal                 *
//***********************************************************************************/


// Base class for message types
message ClusterMessage
{
    fields:
        int proto;
        int srcAddress;
        int destAddress;
}

//***********************************************************************************/
// Status sent from Node to BS
message Status2BSMessage extends ClusterMessage
{
    fields:
        int energy;
        int status;
        int cluster;
        int xpos;
        int ypos;
}

//***********************************************************************************/
// BS sends this message to anounce cluster heads to nodes
message ClusterHeadMessage extends ClusterMessage
{
    fields:
        int cHead[];
}

//***********************************************************************************/
// TDMA message
message TDMAMessage extends ClusterMessage
{
    fields:
        int frames;
        int frameTime;
        int tdma[];      //  constant

}

//***********************************************************************************/
// Data sent by nodes to cluster heads
message DataToCHMessage extends ClusterMessage
{
    fields:
        int cluaterHead;
        int data;
}

//***********************************************************************************/
// Data sent by nodes to BS
message Data2BSMessage extends ClusterMessage
{
    fields:
        int data;
}

//***********************************************************************************/
// Message sent from Event to node
message Event2NodeMessage extends ClusterMessage
{
    fields:
    	int metadata;

}

//***********************************************************************************/
// Message sent from CH to Relay node
message RequestRNMessage extends ClusterMessage
{
    fields:
        int energy;
        int status;
        int xpos;
        int ypos;
}

//***********************************************************************************/
// Data sent by nodes to RN
message Data2RNMessage extends ClusterMessage
{
    fields:
        int data;
		int relayNode;		
}

//***********************************************************************************/



