problem with SINR

636 views
Skip to first unread message

Marcos Costa

unread,
Mar 22, 2021, 5:25:52 PM3/22/21
to ns-3-users

i'm new to ns3 and i need to collect the sine, i'm using lena-x2-handover-measures, i researched the group about it, but the code i can get is not working

void NotifyUeReport (Ptr<OutputStreamWrapper> stream, std::string context, uint16_t cellid, uint16_t rnti, double rsrp , double avsinr){
std::cout << context
<< " eNB CellId " << cellid
<< " RNTI " << rnti
<< " RSRP " << rsrp
<< " SINR " << 10*log(avsinr)/log(10)
<< std::endl;

*stream->GetStream() << Simulator::Now().GetSeconds() <<"\t"<<rnti<<"\t"<<rsrp<< "\t" << 10*log(avsinr) / log(10) <<std::endl;
}
------------------------------
AsciiTraceHelper asciiTraceHelper;
Ptr<OutputStreamWrapper> stream = asciiTraceHelper.CreateFileStream ("ueReport.txt");
--------------------------------
Config::Connect ("/NodeList/*/DeviceList/*/LteUePhy/ReportCurrentCellRsrpSinr",
MakeBoundCallback (&NotifyUeReport, stream));

when I run I get the error:
msg="Could not connect callback to /NodeList/*/DeviceList/*/LteUePhy/ReportCurrentCellRsrpSinr", +0.000000000s -1 file=../src/core/model/config.cc, line=923
terminate called without an active exception
lena-x2-handover-measures

Dr. Kiran M

unread,
Mar 23, 2021, 7:30:43 AM3/23/21
to ns-3-...@googlegroups.com
You were missing one parameter. Use the following code:

void NotifyUeReport (std::string context, uint16_t cellid, uint16_t rnti,double rsrp , double avsinr, uint8_t k)
{
        std::cout << context<<std::endl;
        std::cout<<Simulator::Now().GetSeconds()<<"\teNB CellId="<<cellid <<"\tRNTI="<<rnti<<"\tRSRP="<<rsrp
        <<"\tSINR="<<10*log(avsinr)/log(10)<<std::endl;
}

And a small addition in the Config::Connect 

Config::Connect("/NodeList/*/DeviceList/*/$ns3::LteUeNetDevice/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr",MakeCallback(&NotifyUeReport));

It should work now.

Hope it helps.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/95f73a8b-8968-48cf-a53c-59fb081348d0n%40googlegroups.com.


--
Dr. Kiran Manjappa 
Assistant Professor
Dept. of Information Technology
National Institute of Technology Karnataka (NITK), 
Surathkal, Mangalore, INDIA
- Office 0824-247-3561 

Marcos Costa

unread,
Mar 23, 2021, 10:57:40 AM3/23/21
to ns-3-users
Thanks Dr. Kiran, it worked.
A question, do you know how to use snr and rsrp data to generate graphs?
Reply all
Reply to author
Forward
0 new messages