These kind of errors indicate a mismatch between the callback function (trace sink) signature and the trace source signature.
Here, you are passing SpectrumValue by value, but in the trace source, it is by reference:
TracedCallback<uint64_t, SpectrumValue&,
SpectrumValue&> m_ulSinrTrace; //!< SINR trace
So try modifying your UlSinrTrace accordingly.
- Tom
My aim is to log the Uplink SINR.Has anyone met and solved the same issue, I really don't understand the error:
--________________________________________________The error message "msg="Incompatible types. (feed to "c++filt -t" if needed)
got=CallbackImpl<void,unsigned long,ns3::SpectrumValue,ns3::SpectrumValue>
expected=CallbackImpl<void,unsigned long,ns3::SpectrumValue,ns3::SpectrumValue>", +0.000000000s -1 file=/home/ahh0879/Bureau/projet3/ns-3-dev/src/core/model/callback.h, line=612
+0.000000000s -1 file=/home/ahh0879/Bureau/projet3/ns-3-dev/src/core/model/traced-callback.h, line=132
NS_FATAL, terminating
terminate called without an active exception
"______________________________________________static void
UlSinrTrace (
uint64_t imsi,
SpectrumValue sinr,
SpectrumValue interference)
{
double avgSinr = 0.0;
uint32_t n = 0;
for (auto it = sinr.ConstValuesBegin ();
it != sinr.ConstValuesEnd (); ++it)
{
avgSinr += (*it);
n++;
}
avgSinr /= n;
std::cout
<< Simulator::Now ().GetSeconds ()
<< " IMSI=" << imsi
<< " UL-SINR(avg,dB)=" << 10 * std::log10 (avgSinr)
<< std::endl;
std::cout << "yaaaaaaaaay!";
//Logging
if (gULSinrCsv.is_open())
{
gULSinrCsv << Simulator::Now().GetSeconds() << ","
<< imsi << ","
<< sinr << ","
<< interference << std::endl;
}
}
//After InstallationConfig::ConnectWithoutContextFailSafe (
"/NodeList/0/DeviceList/0/$ns3::NrNetDevice/$ns3::NrGnbNetDevice/BandwidthPartMap/0/NrGnbPhy/UlSinrTrace",
MakeCallback (&UlSinrTrace));
You received this message because you are subscribed to the Google Groups "5G-LENA-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 5g-lena-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/5g-lena-users/ce471c8b-d682-47ec-9bc5-b6fafc087c1en%40googlegroups.com.