//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
//

#ifndef BATTERYPHYLAYER_H_
#define BATTERYPHYLAYER_H_

#include <PhyLayer.h>
#include <SimpleAddress.h>
#include "ExtendedAddress.h"

class BatteryPhyLayer: public PhyLayer {

protected:

	enum Activities {
			RX_ACCT=0,
			TX_ACCT=1,
			SLEEP_ACCT=2,
			IDLE_ACCT=3
		};

    // Different energy consumptions (in J or mW)
    double txEnergy, rxEnergy, amplifierEnergy;
    int transmissions;

    virtual void initialize(int stage);
	virtual void handleUpperMessage(cMessage* msg);
	virtual void handleHostState(const HostState& state);
	virtual void handleAirFrame(cMessage* msg);
	virtual void finish();

//private:
//	double getDistance(int dist);

public:
	void sendUp(AirFrame* frame, DeciderResult* result);

};

#endif /* BATTERYPHYLAYER_H_ */
