Commit 066c2bfc authored by aligungr's avatar aligungr

RLS improvements

parent 5805cdca
......@@ -22,13 +22,15 @@ static constexpr const int TIMER_PERIOD_ACK_SEND = 2250;
namespace nr::ue
{
RlsControlTask::RlsControlTask(TaskBase *base, uint64_t sti) : m_udpTask{}, m_pduMap{}, m_sti{sti}, m_pendingAck{}
RlsControlTask::RlsControlTask(TaskBase *base, uint64_t sti)
: m_mainTask{}, m_udpTask{}, m_pduMap{}, m_sti{sti}, m_pendingAck{}
{
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl");
}
void RlsControlTask::initialize(RlsUdpTask *udpTask)
void RlsControlTask::initialize(NtsTask *mainTask, RlsUdpTask *udpTask)
{
m_mainTask = mainTask;
m_udpTask = udpTask;
}
......@@ -117,7 +119,7 @@ void RlsControlTask::handleRlsMessage(int cellId, rls::RlsMessage &msg)
auto *w = new NwUeRlsToRls(NwUeRlsToRls::DOWNLINK_DATA);
w->psi = static_cast<int>(m.payload);
w->data = std::move(m.pdu);
// TODO: send to upper layer [PSI, DATA]
m_mainTask->push(w);
}
else if (m.pduType == rls::EPduType::RRC)
{
......@@ -125,7 +127,7 @@ void RlsControlTask::handleRlsMessage(int cellId, rls::RlsMessage &msg)
w->cellId = cellId;
w->rrcChannel = static_cast<rrc::RrcChannel>(m.payload);
w->data = std::move(m.pdu);
// TODO: send to upper layer [rrcChannel, DATA]
m_mainTask->push(w);
}
else
{
......@@ -143,7 +145,7 @@ void RlsControlTask::handleSignalChange(int cellId, int dbm)
auto *w = new NwUeRlsToRls(NwUeRlsToRls::SIGNAL_CHANGED);
w->cellId = cellId;
w->dbm = dbm;
// TODO transparently send to the RRC
m_mainTask->push(w);
}
void RlsControlTask::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::RrcChannel channel, OctetString &&data)
......@@ -152,21 +154,21 @@ void RlsControlTask::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::Rr
{
if (m_pduMap.count(pduId))
{
m_pduMap.clear();
auto *w = new NwUeRlsToRls(NwUeRlsToRls::RADIO_LINK_FAILURE);
w->rlfCause = rls::ERlfCause::PDU_ID_EXISTS;
// TODO: issue RLF
m_pduMap.clear();
m_mainTask->push(w);
return;
}
if (m_pduMap.size() > MAX_PDU_COUNT)
{
m_pduMap.clear();
auto *w = new NwUeRlsToRls(NwUeRlsToRls::RADIO_LINK_FAILURE);
w->rlfCause = rls::ERlfCause::PDU_ID_FULL;
// TODO: issue RLF
m_pduMap.clear();
m_mainTask->push(w);
return;
}
......@@ -212,7 +214,7 @@ void RlsControlTask::onAckControlTimerExpired()
auto *w = new NwUeRlsToRls(NwUeRlsToRls::TRANSMISSION_FAILURE);
w->pduList = std::move(transmissionFailures);
// TODO: Notify transmission failures
m_mainTask->push(w);
}
void RlsControlTask::onAckSendTimerExpired()
......
......@@ -25,6 +25,7 @@ class RlsControlTask : public NtsTask
{
private:
std::unique_ptr<Logger> m_logger;
NtsTask *m_mainTask;
RlsUdpTask *m_udpTask;
std::unordered_map<uint32_t, rls::PduInfo> m_pduMap;
uint64_t m_sti;
......@@ -40,7 +41,7 @@ class RlsControlTask : public NtsTask
void onQuit() override;
public:
void initialize(RlsUdpTask *udpTask);
void initialize(NtsTask *mainTask, RlsUdpTask *udpTask);
private:
void handleRlsMessage(int cellId, rls::RlsMessage &msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment