NrRlcUmTxEntity.h Source File

Simu5G: NrRlcUmTxEntity.h Source File
Simu5G
NrRlcUmTxEntity.h
1//
2// Simu5G
3//
4// Authors: Esteban Egea Lopez (Universidad Politecnica de Cartagena), Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _SIMU5G_NRRLCUMTXENTITY_H_
13#define _SIMU5G_NRRLCUMTXENTITY_H_
14
15#include "simu5g/stack/rlc/um/RlcUmTxEntityBase.h"
16#include "simu5g/stack/rlc/um/RlcUmTransmitterBuffer.h"
17
18namespace simu5g {
19
20using namespace omnetpp;
21
30{
31 protected:
32 // The SDU segmentation buffer.
33 RlcUmTransmitterBuffer *sduBuffer = nullptr;
34
35 // UM SN field length in bits (TS 38.322: 6 or 12).
36 unsigned int sn_FieldLength = 12;
37
38 public:
39
40 ~NrRlcUmTxEntity() override
41 {
42 if (sduBuffer) {
43 sduBuffer->clearBuffer();
44 delete sduBuffer;
45 }
46 }
47
48 void clearQueue() override;
49 bool isTxBufferEmpty() const override { return !sduBuffer->hasData(); }
50 int64_t getBufferOccupancy() const override { return sduBuffer ? (int64_t)sduBuffer->getTotalPendingBytes() : 0; }
51
52 protected:
53
54 void initMode() override;
55 bool storeSdu(inet::Packet *pkt) override;
56 void rlcPduMake(int pduSize) override;
57 unsigned int snFieldLength() const override { return sn_FieldLength; }
58
59};
60
61} //namespace
62
63#endif
NR (TS 38.322) RLC UM transmission entity.
Definition NrRlcUmTxEntity.h:30
Common shell of the RLC UM transmission entity.
Definition RlcUmTxEntityBase.h:40
Definition AlertReceiver.h:24