Commit fdf86aaf authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 06b09000
......@@ -59,10 +59,10 @@ void UeAppTask::onLoop()
auto *tunTask = m_tunTasks[w->psi];
if (tunTask)
{
auto *nw = new NmAppToTun(NmAppToTun::DATA_PDU_DELIVERY);
nw->psi = w->psi;
nw->data = std::move(w->pdu);
tunTask->push(nw);
auto *m = new NmAppToTun(NmAppToTun::DATA_PDU_DELIVERY);
m->psi = w->psi;
m->data = std::move(w->pdu);
tunTask->push(m);
}
break;
}
......
......@@ -166,10 +166,10 @@ void NasMm::sendNasMessage(const nas::PlainMmMessage &msg)
}
}
auto *nw = new NmUeNasToRrc(NmUeNasToRrc::UPLINK_NAS_DELIVERY);
nw->pduId = 0;
nw->nasPdu = std::move(pdu);
m_base->rrcTask->push(nw);
auto *m = new NmUeNasToRrc(NmUeNasToRrc::UPLINK_NAS_DELIVERY);
m->pduId = 0;
m->nasPdu = std::move(pdu);
m_base->rrcTask->push(m);
}
void NasMm::receiveNasMessage(const nas::NasMessage &msg)
......
......@@ -58,10 +58,10 @@ void NasSm::handleUplinkDataRequest(int psi, OctetString &&data)
handleUplinkStatusChange(psi, false);
}
auto *nw = new NmUeNasToRls(NmUeNasToRls::DATA_PDU_DELIVERY);
nw->psi = psi;
nw->pdu = std::move(data);
m_base->rlsTask->push(nw);
auto *m = new NmUeNasToRls(NmUeNasToRls::DATA_PDU_DELIVERY);
m->psi = psi;
m->pdu = std::move(data);
m_base->rlsTask->push(m);
}
else
{
......
......@@ -123,9 +123,9 @@ void NasTask::onLoop()
void NasTask::performTick()
{
auto sendExpireMsg = [this](UeTimer *timer) {
auto *nw = new NmUeNasToNas(NmUeNasToNas::NAS_TIMER_EXPIRE);
nw->timer = timer;
push(nw);
auto *m = new NmUeNasToNas(NmUeNasToNas::NAS_TIMER_EXPIRE);
m->timer = timer;
push(m);
};
if (timers.t3346.performTick())
......
......@@ -93,11 +93,11 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH_Message *msg)
return;
}
auto *nw = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
nw->cellId = cellId;
nw->channel = rrc::RrcChannel::UL_CCCH;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
auto *m = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
m->cellId = cellId;
m->channel = rrc::RrcChannel::UL_CCCH;
m->pdu = std::move(pdu);
m_base->rlsTask->push(m);
}
void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg)
......@@ -109,11 +109,11 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg)
return;
}
auto *nw = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
nw->cellId = cellId;
nw->channel = rrc::RrcChannel::UL_CCCH1;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
auto *m = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
m->cellId = cellId;
m->channel = rrc::RrcChannel::UL_CCCH1;
m->pdu = std::move(pdu);
m_base->rlsTask->push(m);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
......@@ -125,11 +125,11 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
return;
}
auto *nw = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
nw->cellId = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; });
nw->channel = rrc::RrcChannel::UL_DCCH;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
auto *m = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
m->cellId = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; });
m->channel = rrc::RrcChannel::UL_DCCH;
m->pdu = std::move(pdu);
m_base->rlsTask->push(m);
}
void UeRrcTask::receiveRrcMessage(int cellId, ASN_RRC_BCCH_BCH_Message *msg)
......
......@@ -64,9 +64,9 @@ void UeRrcTask::receiveDownlinkInformationTransfer(const ASN_RRC_DLInformationTr
OctetString nasPdu =
asn::GetOctetString(*msg.criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message);
auto *nw = new NmUeRrcToNas(NmUeRrcToNas::NAS_DELIVERY);
nw->nasPdu = std::move(nasPdu);
m_base->nasTask->push(nw);
auto *m = new NmUeRrcToNas(NmUeRrcToNas::NAS_DELIVERY);
m->nasPdu = std::move(nasPdu);
m_base->nasTask->push(m);
}
} // namespace nr::ue
\ No newline at end of file
......@@ -37,9 +37,9 @@ static std::string GetErrorMessage(const std::string &cause)
static nr::ue::NmUeTunToApp *NmError(std::string &&error)
{
auto *nw = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::TUN_ERROR);
nw->error = std::move(error);
return nw;
auto *m = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::TUN_ERROR);
m->error = std::move(error);
return m;
}
static void ReceiverThread(ReceiverArgs *args)
......@@ -54,7 +54,7 @@ static void ReceiverThread(ReceiverArgs *args)
while (true)
{
int n = ::read(fd, buffer, RECEIVER_BUFFER_SIZE);
ssize_t n = ::read(fd, buffer, RECEIVER_BUFFER_SIZE);
if (n < 0)
{
targetTask->push(NmError(GetErrorMessage("TUN device could not read")));
......@@ -63,10 +63,10 @@ static void ReceiverThread(ReceiverArgs *args)
if (n > 0)
{
auto *nw = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::DATA_PDU_DELIVERY);
nw->psi = psi;
nw->data = OctetString::FromArray(buffer, static_cast<size_t>(n));
targetTask->push(nw);
auto *m = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::DATA_PDU_DELIVERY);
m->psi = psi;
m->data = OctetString::FromArray(buffer, static_cast<size_t>(n));
targetTask->push(m);
}
}
}
......@@ -104,7 +104,7 @@ void TunTask::onLoop()
{
case NtsMessageType::UE_APP_TO_TUN: {
auto *w = dynamic_cast<NmAppToTun *>(msg);
int res = ::write(m_fd, w->data.data(), w->data.length());
ssize_t res = ::write(m_fd, w->data.data(), w->data.length());
if (res < 0)
push(NmError(GetErrorMessage("TUN device could not write")));
else if (res != w->data.length())
......
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