5g lena v2x-v1.1 sidelink rssi callback question (rssi)

120 views
Skip to first unread message

meatHo

unread,
Jul 25, 2025, 6:48:18 AM7/25/25
to ns-3-users
I can't connect the callback which i made with TracedCallback.

in the nr-sl-interference.h file, i added
TracedCallback<double> m_slRssiPerProcessedChunk;
 to trace the sidelink RSSI.

And of course I added nr-sl-interference.cc file the trace at the TypeId.
TypeId
NrSlInterference::GetTypeId()
{
    static TypeId tid =
        TypeId("ns3::NrSlInterference")
            .SetParent<Object>()
            .AddTraceSource("SlRssiPerProcessedChunk",
                            "Rssi per processed chunk1.",
                            MakeTraceSourceAccessor(&NrSlInterference::m_slRssiPerProcessedChunk),
                            "ns3::SlRssiPerProcessedChunk::TracedCallback");
    ;
    return tid;
}

And at the ConditionallyEvaluateChunk I added the function to save rssi.
            double rssidBm = 10 * log10(Sum((*m_noise + *m_allSignals)) * 1000);
            m_slRssiPerProcessedChunk(rssidBm);

I added the nr-sl-interference.cc at the attachment.
And in my scratch code I added the callback with this code.
    Ptr<NetDevice> dev1 = rsuNetDev.Get (0);
    Ptr<NrUeNetDevice> ueDev1 = DynamicCast<NrUeNetDevice> (dev1);
    Ptr<NrSpectrumPhy> spectrumPhy1 = ueDev1->GetPhy (0)->GetSpectrumPhy ();
    Ptr<NrSlInterference> interference1 = spectrumPhy1->GetSlInterference();
    interference1->TraceConnectWithoutContext(
    "SlRssiPerProcessedChunk",
    MakeBoundCallback(&UeSlRssiPerProcessedChunk, spectrumPhy1));

But it doesn't work....
at the nr-sl-interference I checked the rssi with the NS_LOG_UNCOND and the rssi revealed. But the callback doesn't work..

Can you please help me?...

Thank you in advance for your answers.


nr-sl-interference.cc
Reply all
Reply to author
Forward
0 new messages