//*******************************************************************************
//*  Copyright (c) Federal University of Para, Brazil - 2012			*
//*  Developed at the Research Group on Computer Network and Multimedia		*
//*  Communication (GERCOM)							*
//*  All rights reserved							*
//*										*
//*  Permission to use, copy, modify, and distribute this protocol and its	*
//*  documentation for any purpose, without fee, and without written		*
//*  agreement is hereby granted, provided that the above copyright notice,	*
//*  and the author appear in all copies of this protocol.			*
//*										*
//*  Version:  0.1								*
//*  Author(s): Denis do Rosário <denis@ufpa.br>				*
//*										*
//******************************************************************************/

#ifndef THROUGHPUTTEST_H_
#define THROUGHPUTTEST_H_

#include "WiseBaseApplication.h"
#include "VirtualMobilityManager.h"

enum ThroughputTestTimers {
	SEND_PACKET 	= 1,
};

/*
 * Base class for criticality-based sensor nodes.
 */
class ThroughputTest: public WiseBaseApplication {
private:
	double packet_rate;
	string recipientAddress;
	double startupDelay;

	float packet_spacing;
	int dataSN;
public:
	ThroughputTest();
	virtual ~ThroughputTest();

protected:
	virtual void initialize();
	virtual void startup() {}
	virtual void finish();
	virtual void finishSpecific() {};
	virtual void fromNetworkLayer(cPacket* pkt, const char* src, double rssi, double lqi);
	virtual void handleMobilityControlMessage(MobilityManagerMessage *);
	virtual void handleSensorReading(WiseSensorMessage* msg);
	virtual void handleDirectApplicationMessage(WiseApplicationPacket* pkt);
	void timerFiredCallback(int);

	bool isSink;
};

#endif /* CRITAPP_H_ */
