-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSendEvent.cc
54 lines (45 loc) · 986 Bytes
/
SendEvent.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* SendEvent.cc
*
* Created on: 25.06.2020
* Author: krassus
*/
#include "ns3/log.h"
#include "ns3/core-module.h"
#include "SendEvent.h"
namespace ns3
{
SendEvent::SendEvent(Ptr<GameState> gs, Ptr<EEBTProtocol> prot, FRAME_TYPE ft, Mac48Address recipient, double txPower, uint16_t seqNo) : EventImpl()
{
this->gs = gs;
this->prot = prot;
this->ft = ft;
this->seqNo = seqNo;
this->recipient = recipient;
this->txPower = txPower;
this->counter = 0;
}
SendEvent::~SendEvent() {}
void SendEvent::Notify()
{
//NS_LOG_UNCOND("[" << Now() << "]: SendEvent fired!");
this->prot->Send(this->gs, this->ft, this->recipient, seqNo, this->txPower, this);
this->counter++;
}
uint32_t SendEvent::getNTimes()
{
return this->counter;
}
void SendEvent::updateTxPower(double txPower)
{
this->txPower = txPower;
}
uint16_t SendEvent::getSeqNo()
{
return this->seqNo;
}
void SendEvent::setSeqNo(uint16_t seqNo)
{
this->seqNo = seqNo;
}
}