I'm new to NS3. I have a query in changing the pointtopoint link datarate during the runtime. I tried a solution which is mentioned in https://stackoverflow.com/a/65514090/13121848. But here SetDeviceAttribute is not resolved for me.
void
ModifyLinkRate(PointToPointNetDevice *dev) {
dev->SetDeviceAttribute("DataRate", StringValue ("1Mbps"));
//dev->SetAttribute("DataRate", StringValue ("1Mbps"));
}
int
main (int argc, char *argv[])
{
...
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue (linkRate));
...
Simulator::Schedule(Seconds(2.0), &ModifyLinkRate, &pointToPoint );
}