Comments (5)
If you want a fixed packet size, you can directly change the code in EndDeviceStatus::GetCompleteReplyPacket
to create a packet with a set payload size!
from lorawan.
Hello @DvdMgr
I have been modifying EndDeviceStatus.cc file for my convenience and I am facing some issue in it.
- I have used a code to modify replypaylaod size as given below
for (NodeContainer::Iterator j = endDevices.Begin ();
j != endDevices.End (); ++j)
{
Ptr<Node> node = *j;
uint32_t senderID = node->GetId ();
std::cout << "senderID: " << senderID << std::endl;
Ptr<LoraNetDevice> loraNetDevice = node->GetDevice(0)->GetObject<LoraNetDevice> ();
Ptr<LoraPhy> phy = loraNetDevice->GetPhy ();
Ptr<LoraMac> mac = loraNetDevice->GetMac ();
Ptr<EndDeviceLoraMac> edLoraMac = mac->GetObject<EndDeviceLoraMac> ();
LoraDeviceAddress Address = edLoraMac->GetDeviceAddress();
Ptr<EndDeviceStatus> edStatusP3 = CreateObject<EndDeviceStatus> (Address, edLoraMac);
Ptr <Packet> replypayload = Create<Packet> (126);
edStatusP3->SetReplyPayload (replypayload);
LoraFrameHeader d = edStatusP3->GetReplyFrameHeader();
std::cout<< d << std::endl;
}
Above I am changing the attaching the payload with Setreplypayload() but still I can see output as below
It is creating an empty packet instead of creating a packet with size I have already stated.
My idea is to emulate handshake between NS and end device and so I want to create reply packet according to the size of uplink packet.
for example if uplink packet size is 30 byte then downlink packet should be 23
if uplink packet size is 50 byte then downlink packet should be 15
Thanks and Regards
@Prapi123
from lorawan.
In that case, you have two ways to go about it:
- Undo your changes to
end-device-status.cc
, and create a newNetworkControllerComponent
object - this will need to implement aBeforeSendingReply
method, which is a callback called by theNetworkController
before sending a reply, and is where you will have the chance to modify theEndDeviceStatus
's reply payload by calling theSetReplyPayload
method. You can use the components defined innetwork-controller-components.cc
file to draw some inspiration about the structure and functionality. Don't forget to add it to theInstallComponents
method of theNetworkServerHelper
to activate it! - Define all the needed logic directly inside the
GetCompleteReplyPacket
method: you can remove the if/else that either uses the m_reply.payload or creates a new packet from scratch, and make it so that it always creates a packet with the needed size. If you want to always send a packet with a payload of 50, for instance, you simply usereplyPacket = Create<Packet> (50);
.
The code you mentioned above does not work because you are creating new EndDeviceStatus
objects, instead of acting upon the ones that already exist and are used in the simulation!
from lorawan.
Hello,
Thanks for responding to this issue.
I could emulate TLS handshake with above recommended process.
I am trying to solve minor error, I want to create a packet replyPacket = Create (1200);
if gives an error "large integer implicitly truncated to unsigned type [-Woverflow] "
I suppose this is due to range of Unsigned integer which is 0-255 so tried to change data-type in source file. Still no luck.
from lorawan.
from lorawan.
Related Issues (20)
- How does lorawan-energy-model-example.cc suppose to work ?
- Simulation with LoRa (without LoRaWAN stack)
- LoRa Mesh module contribution?
- Lack of maintenance + alternatives
- lorawan: Ongoing changes to the module
- Issue with LoraFrameHeader while Handling the address part in LoRaWAN MAC Layer for Multiple End Devices
- test.py failing with "Packet changed contents when going through the channel" HOT 3
- m_receiveCallback in Receive function in lora-net-device HOT 4
- Performance metrics HOT 2
- Questions about complete network example HOT 3
- lorawan module paccket indicated as lost and received successfully at the same time HOT 2
- Unable to read LoraFrameHeader for uplink messages (using gw mac) HOT 2
- Broken documentation HOT 2
- How to run a simple scenario in aloha , slotted aloha and tdma? HOT 1
- How to integrate a new model HOT 2
- Transmission disappearing when sent before second Rx window HOT 2
- onoffhelper HOT 2
- How to use NetAnim while simulating lora? HOT 2
- rs-example code HOT 6
- Challenges understanding error in NS3 lorawan module HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lorawan.