Commit 9d361386 authored by aligungr's avatar aligungr

RLS developments

parent f8029dd7
......@@ -254,13 +254,14 @@ struct NwUeRlsToRls : NtsMessage
DOWNLINK_RRC,
RADIO_LINK_FAILURE,
TRANSMISSION_FAILURE,
ASSIGN_SERVING_CELL,
} present;
// RECEIVE_RLS_MESSAGE
// UPLINK_RRC
// DOWNLINK_RRC
// SIGNAL_CHANGED
// UPLINK_DATA
// ASSIGN_SERVING_CELL
int cellId{};
// RECEIVE_RLS_MESSAGE
......
......@@ -23,7 +23,7 @@ namespace nr::ue
{
RlsControlTask::RlsControlTask(TaskBase *base, uint64_t sti)
: m_mainTask{}, m_udpTask{}, m_pduMap{}, m_sti{sti}, m_pendingAck{}
: m_mainTask{}, m_udpTask{}, m_pduMap{}, m_sti{sti}, m_pendingAck{}, m_servingCell{}
{
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl");
}
......@@ -59,11 +59,14 @@ void RlsControlTask::onLoop()
handleRlsMessage(w->cellId, *w->msg);
break;
case NwUeRlsToRls::UPLINK_DATA:
handleUplinkDataDelivery(w->cellId, w->psi, std::move(w->data));
handleUplinkDataDelivery(w->psi, std::move(w->data));
break;
case NwUeRlsToRls::UPLINK_RRC:
handleUplinkRrcDelivery(w->cellId, w->pduId, w->rrcChannel, std::move(w->data));
break;
case NwUeRlsToRls::ASSIGN_SERVING_CELL:
m_servingCell = w->cellId;
break;
default:
m_logger->unhandledNts(msg);
break;
......@@ -111,10 +114,13 @@ void RlsControlTask::handleRlsMessage(int cellId, rls::RlsMessage &msg)
m_pendingAck[cellId].push_back(m.pduId);
if (m.pduType == rls::EPduType::DATA)
{
if (cellId != m_servingCell)
{
// NOTE: Data packet may be received from a cell other than serving cell
// (This is not a problem for RRC, but for DATA), normally we should avoid this, no need for now.
(void)cellId;
// Ignore the packet if this is the case. Other cell can only send RRC, but not DATA
return;
}
auto *w = new NwUeRlsToRls(NwUeRlsToRls::DOWNLINK_DATA);
w->psi = static_cast<int>(m.payload);
......@@ -186,7 +192,7 @@ void RlsControlTask::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::Rr
m_udpTask->send(cellId, msg);
}
void RlsControlTask::handleUplinkDataDelivery(int cellId, int psi, OctetString &&data)
void RlsControlTask::handleUplinkDataDelivery(int psi, OctetString &&data)
{
rls::RlsPduTransmission msg{m_sti};
msg.pduType = rls::EPduType::DATA;
......@@ -194,7 +200,7 @@ void RlsControlTask::handleUplinkDataDelivery(int cellId, int psi, OctetString &
msg.payload = static_cast<uint32_t>(psi);
msg.pduId = 0;
m_udpTask->send(cellId, msg);
m_udpTask->send(m_servingCell, msg);
}
void RlsControlTask::onAckControlTimerExpired()
......
......@@ -30,6 +30,7 @@ class RlsControlTask : public NtsTask
std::unordered_map<uint32_t, rls::PduInfo> m_pduMap;
uint64_t m_sti;
std::unordered_map<int, std::vector<uint32_t>> m_pendingAck;
int m_servingCell;
public:
explicit RlsControlTask(TaskBase *base, uint64_t sti);
......@@ -47,7 +48,7 @@ class RlsControlTask : public NtsTask
void handleRlsMessage(int cellId, rls::RlsMessage &msg);
void handleSignalChange(int cellId, int dbm);
void handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::RrcChannel channel, OctetString &&data);
void handleUplinkDataDelivery(int cellId, int psi, OctetString &&data);
void handleUplinkDataDelivery(int psi, OctetString &&data);
void onAckControlTimerExpired();
void onAckSendTimerExpired();
};
......
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