提交 39a1bb58 编写于 作者: C calincerchez

mac

上级 ab0ee629
......@@ -20,7 +20,7 @@
class HARQEntity {
private:
std::vector<HARQProcess*> procs;
std::map<unsigned, HARQProcess*> procs;
public:
HARQEntity();
virtual ~HARQEntity();
......
......@@ -24,7 +24,8 @@
Define_Module(MAC);
MAC::MAC() {
// TODO Auto-generated constructor stub
// TODO Auto-generated constructor stub
ttiId = 0;
}
MAC::~MAC() {
......@@ -40,14 +41,22 @@ void MAC::initialize(int stage) {
rnti = uniform(RA_RNTI_MIN_VALUE, RA_RNTI_MAX_VALUE);
sendDown(new cPacket("RandomAccessRequest"), PRACH, RandomAccessRequest, RaRnti, rnti, 1);
}
ttiTimer = new cMessage("TTI-TIMER");
this->scheduleAt(simTime() + TTI_TIMER_TIMEOUT, ttiTimer);
ttiTimer->setContextPointer(this);
}
}
void MAC::handleMessage(cMessage *msg) {
if (msg->arrivedOn("lowerLayerIn")) {
handleLowerMessage(msg);
if (msg->isSelfMessage()) {
} else {
handleUpperMessage(msg);
if (msg->arrivedOn("lowerLayerIn")) {
handleLowerMessage(msg);
} else {
handleUpperMessage(msg);
}
}
}
......
......@@ -25,6 +25,7 @@
#define RA_RNTI_MAX_VALUE 60
#define C_RNTI_MIN_VALUE 1
#define C_RNTI_MAX_VALUE 65523
#define TTI_TIMER_TIMEOUT 1
class MAC : public cSimpleModule, public INotifiable {
protected:
......@@ -33,6 +34,9 @@ protected:
NotificationBoard *nb;
virtual void receiveChangeNotification(int category, const cPolymorphic *details) {}
cMessage *ttiTimer;
unsigned ttiId;
public:
MAC();
virtual ~MAC();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册