/***************************************************************************************
*	This software simulated for ARPEES, a routing 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: ArpeesDef.h													           *
*	header file for definitions using in the protocol						           *
************************************************************************************/

#ifndef ARPEESDIF_H
#define ARPEESDIF_H

#define NANO 0.001
#define PICO 0.000001
#define M_PI 3.1415926535

#define NUMBERNODES  1500
#define NUMBERROUND  1000
#define MAXEVENTS	 50			// max number of events
#define MAXNEIGHBORS 50

#define SIGNAL		25*8		// 25 bytes
#define DATA		500*8		// 500 bytes
#define SIGNAL2BS	25

// node status
#define STATUS_LIVE       1     
#define STATUS_DEAD       2  
#define STATUS_REDUN	  3   

// messagetypes for clusters
#define CL_TOBS           3
#define CL_TOHEAD         4
#define CL_TDMA           5
#define CL_CHDATA         6
#define CL_RNDATA		  7
#define CL_DATA_RN2BS		8
#define CL_TO_FREE_NODE		18
#define CL_TO_REDUN_NODE	19
#define CL_TO_DEAD_NODE		20


// self message types
#define SMSG_DATA2RNBS		9		// cluster head sends data to RN/BS
#define SMSG_DATA_NODE2CH	10		// node send data to cluster head
#define SMSG_STATUS2BS		14		// nodes send their new status to BS
#define SMSG_INIT			15		// init updates
#define SMSG_MAKETDMA		16
#define BROADCAST			17

struct _adv
{
    int id;
    double energy;
    int status;
    int xpos;
    int ypos;
	double kd;
	int delay;	//mirco-second
	int hop;
};
// define some events and times
#define INIT_WAIT   1     // wait to init nodes
#define ON			1
#define OFF			0


#endif
/************************************************************************************/

