signetlabdei / lorawan

An ns-3 module for simulation of LoRaWAN networks
GNU General Public License v2.0
184 stars 130 forks source link

adr-example broken because of missing DataRate trace source in end-device-lorawan-mac.cc #104

Closed renzoe closed 3 years ago

renzoe commented 3 years ago

Expected Behavior

A correct execution of the adr-example

Actual Behavior

The example uses a Trace Source that is no longer there (DataRate), hence it exits ungracefully.

msg="Could not connect callback to /NodeList/*/DeviceList/0/$ns3::LoraNetDevice/Mac/$ns3::EndDeviceLorawanMac/DataRate", +0.000000000s -1 file=../src/core/model/config.cc, line=904
terminate called without an active exception
Command ['./ns-3-dev/build/src/lorawan/examples/ns3-dev-adr-example-debug'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --gdb").

Steps to Reproduce the Problem

  1. run the adr-example./waf --run "src/lorawan/examples/adr-example"

Specifications

Suggestion:

Here is the problem: https://github.com/signetlabdei/lorawan/commit/f8b6c6de52a1a557acd6ef59b47427b5d09fbfe0#diff-d327974277fff0419d66dea9b1c0bdc62e1e79e8591a4a3276fa9643bc3a39a1

I suggest adding the .AddTraceSource ("DataRate", ... to model/end-device-lorawan-mac.cc again; also, this a very useful trace source to have available!

I can do a pull request if it suits you. Thank you publicly for this wonderful effort/code Davide , team , and community!

DvdMgr commented 3 years ago

Reverted, thank you for pointing this out! In my (limited) testing, adr-example.cc now works as expected.