Thanks for your help. first I tried to add other callback for PhyTxBegin in my main class. like this:
void PhyTxBeginTracedCallback(const std::string& context, Ptr<const Packet> packet, double txPowerW)
{
std::cout << "PhyTxBegin: Context=" << context << ", Packet=" << packet << ", Power=" << txPowerW << std::endl;
}
Config::Connect("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/PhyTxBegin",
MakeCallback(&PhyTxBeginTracedCallback));
but it didnt work and the error was same:
msg="Incompatible types. (feed to "c++filt -t" if needed)
got=CallbackImpl<void,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<ns3::Packet const>, double>
expected=CallbackImpl<void,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<ns3::Packet const>,double>", +0.000000000s -1
file=/home/negar/workspace/ns-allinone-3.38/ns-3.38/src/core/model/callback.h, line=629
msg="when connecting to /NodeList/0/DeviceList/0/$ns3::WaveNetDevice/PhyEntities/0/$ns3::WifiPhy/PhyTxBegin", +0.000000000s -1
file=/home/negar/workspace/ns-allinone-3.38/ns-3.38/src/core/model/traced-callback.h, line=155
after reading your answer, I changed these callbacks in my src/netanim/model folder also WavePhyRxBeginTrace too.
but now I am faced with this error:
NS_ASSERT failed, cond="false", msg="WavePhyRxBeginTrace: unknown Uid", +177.000119082s 10 file=/home/negar/workspace/ns-allinone-3.38/ns-3.38/src/netanim/model/animation-interface.cc, line=1114
NS_FATAL, terminating
I generate my packets in this way:
TxInfo tx;
tx.channelNumber = CCH;
tx.dataRate = m_mode;
Ptr<Packet> packet = Create<Packet>(m_packetSize);
CustomDataTag tag;
tag.SetNodeId(GetNode()->GetId());
tag.SetPosition(GetNode()->GetObject<MobilityModel>()->GetPosition());
tag.SetClusterId(m_clusterId);
packet->AddPacketTag(tag);
/* Broadcast the packet as WSMP (0x88dc) */
m_waveDevice->SendX(packet, Mac48Address::GetBroadcast(), 0x88dc, tx);