Tommaso, thank you again.
I took a look at some net-devices, specially at the Carrier Sense example as u said. What is done is some kind of signaling based on flags at the channel level, right? If i got it right, I think that what I would need is something pretty much like this, since I could have many flags to represent the different signals, and specify a delay for reading and writing those flags.
But, between the net-devices, I found more appropriate the PointToPoint Net device. My network will be based in only p2p connections, and as less overhead as possible is desirable, so not even a MAC address is required. Also, it is very simple.
From that, I started a new module called "usn", which is a copy of the point-to-point module, in such a way that, after making the first advances with this development, I would start changing/removing/adding stuff from/to this module.
I started well, and then I have usn-channel, usn-remote-channell, usn-header, usn-net-device, usn-helper etc.... But now Im facing a problem which is somehow beyond my understanding now.
When I call the helper, just like the p2p-helper does, it creates two net devices, in my case usn-net-devices, and attach it to the nodes. But, whenever I try to reach this net-devices again, later on in the code, the node actually returns a NetDevice, but not the usn-net-device, which the helper have added it to. So, can I access the net-device i've created, by accessing the node?
I'm afraid I was a confusing. But follows the code In any case, where my doubt is bellow:
******************************************+
void
network_discovery() {
Ptr<Packet> pck = Create<Packet> (10); //10 bytes of dummy data
Ptr<USNNetDevice> nd; <----------------------------------------------------------------Depending on the Pointer type ....
Address mac_address = Mac48Address("ff:ff:ff:ff:ff:ff");
uint32_t n_nodes = m_nodes.GetN();
Ptr<Node> n = m_nodes.Get(i);
uint16_t n_nodes = n->GetNDevices();
if (n_nodes > 0) {
nd = n->GetDevice(0); <--------------------------------- Error on doing this convention, or...
nd->Send(pck, mac_address, 0x800);
nd->SendPacket(pck); <----------------------------------- Error on finding this method.
+++++++++++++++++++++++++++
Thank you very much!