diff --git a/NS3-VERSION b/NS3-VERSION index 064620872d..65de719866 100644 --- a/NS3-VERSION +++ b/NS3-VERSION @@ -1 +1 @@ -release ns-3.29 \ No newline at end of file +release ns-3.40 \ No newline at end of file diff --git a/VERSION b/VERSION index 9e11b32fca..d15723fbe8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +0.3.2 diff --git a/examples/wscript b/examples/wscript deleted file mode 100644 index 9cdd04c33e..0000000000 --- a/examples/wscript +++ /dev/null @@ -1,27 +0,0 @@ -# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- - - -def build(bld): - obj = bld.create_ns3_program('simple-network-example', ['lorawan']) - obj.source = 'simple-network-example.cc' - - obj = bld.create_ns3_program('network-server-example', ['lorawan']) - obj.source = 'network-server-example.cc' - - obj = bld.create_ns3_program('complete-network-example', ['lorawan']) - obj.source = 'complete-network-example.cc' - - obj = bld.create_ns3_program('adr-example', ['lorawan']) - obj.source = 'adr-example.cc' - - obj = bld.create_ns3_program('lorawan-energy-model-example', ['lorawan']) - obj.source = 'lorawan-energy-model-example.cc' - - obj = bld.create_ns3_program('aloha-throughput', ['lorawan']) - obj.source = 'aloha-throughput.cc' - - obj = bld.create_ns3_program('parallel-reception-example', ['lorawan']) - obj.source = 'parallel-reception-example.cc' - - obj = bld.create_ns3_program('frame-counter-update', ['lorawan']) - obj.source = 'frame-counter-update.cc' diff --git a/helper/forwarder-helper.cc b/helper/forwarder-helper.cc index e7820d6341..e5dd89a19b 100644 --- a/helper/forwarder-helper.cc +++ b/helper/forwarder-helper.cc @@ -79,7 +79,7 @@ ForwarderHelper::InstallPriv (Ptr node) const for (uint32_t i = 0; i < node->GetNDevices (); i++) { Ptr currentNetDevice = node->GetDevice (i); - if (currentNetDevice->GetObject () != 0) + if (bool(currentNetDevice->GetObject()) != 0) { Ptr loraNetDevice = currentNetDevice->GetObject (); @@ -87,7 +87,7 @@ ForwarderHelper::InstallPriv (Ptr node) const loraNetDevice->SetReceiveCallback (MakeCallback (&Forwarder::ReceiveFromLora, app)); } - else if (currentNetDevice->GetObject () != 0) + else if (bool(currentNetDevice->GetObject ()) != 0) { Ptr pointToPointNetDevice = currentNetDevice->GetObject (); diff --git a/helper/lora-helper.cc b/helper/lora-helper.cc index 80a5822ccf..b18e306ca8 100644 --- a/helper/lora-helper.cc +++ b/helper/lora-helper.cc @@ -57,7 +57,7 @@ NS_LOG_COMPONENT_DEFINE ("LoraHelper"); // Create the PHY Ptr phy = phyHelper.Create (node, device); - NS_ASSERT (phy != 0); + NS_ASSERT (bool(phy) != 0); device->SetPhy (phy); NS_LOG_DEBUG ("Done creating the PHY"); @@ -104,7 +104,7 @@ NS_LOG_COMPONENT_DEFINE ("LoraHelper"); // Create the MAC Ptr mac = macHelper.Create (node, device); - NS_ASSERT (mac != 0); + NS_ASSERT (bool(mac) != 0); mac->SetPhy (phy); NS_LOG_DEBUG ("Done creating the MAC"); device->SetMac (mac); @@ -217,10 +217,10 @@ LoraHelper::DoPrintDeviceStatus (NodeContainer endDevices, NodeContainer gateway { Ptr object = *j; Ptr position = object->GetObject (); - NS_ASSERT (position != 0); + NS_ASSERT (bool(position) != 0); Ptr netDevice = object->GetDevice (0); Ptr loraNetDevice = netDevice->GetObject (); - NS_ASSERT (loraNetDevice != 0); + NS_ASSERT (bool(loraNetDevice) != 0); Ptr mac = loraNetDevice->GetMac ()->GetObject (); int dr = int(mac->GetDataRate ()); double txPower = mac->GetTransmissionPower (); diff --git a/helper/lorawan-mac-helper.cc b/helper/lorawan-mac-helper.cc index 3de51c6de3..44a3e903a7 100644 --- a/helper/lorawan-mac-helper.cc +++ b/helper/lorawan-mac-helper.cc @@ -77,7 +77,7 @@ LorawanMacHelper::Create (Ptr node, Ptr device) const mac->SetDevice (device); // If we are operating on an end device, add an address to it - if (m_deviceType == ED_A && m_addrGen != 0) + if (m_deviceType == ED_A && bool(m_addrGen) != 0) { mac->GetObject ()->SetDeviceAddress (m_addrGen->NextAddress ()); } @@ -461,13 +461,13 @@ LorawanMacHelper::SetSpreadingFactorsUp (NodeContainer endDevices, NodeContainer { Ptr object = *j; Ptr position = object->GetObject (); - NS_ASSERT (position != 0); + NS_ASSERT (bool(position) != 0); Ptr netDevice = object->GetDevice (0); Ptr loraNetDevice = netDevice->GetObject (); - NS_ASSERT (loraNetDevice != 0); + NS_ASSERT (bool(loraNetDevice) != 0); Ptr mac = loraNetDevice->GetMac ()->GetObject (); - NS_ASSERT (mac != 0); + NS_ASSERT (bool(mac) != 0); // Try computing the distance from each gateway and find the best one Ptr bestGateway = gateways.Get (0); @@ -620,13 +620,13 @@ LorawanMacHelper::SetSpreadingFactorsGivenDistribution (NodeContainer endDevices { Ptr object = *j; Ptr position = object->GetObject (); - NS_ASSERT (position != 0); + NS_ASSERT (bool(position) != 0); Ptr netDevice = object->GetDevice (0); Ptr loraNetDevice = netDevice->GetObject (); - NS_ASSERT (loraNetDevice != 0); + NS_ASSERT (bool(loraNetDevice) != 0); Ptr mac = loraNetDevice->GetMac ()->GetObject (); - NS_ASSERT (mac != 0); + NS_ASSERT (bool(mac) != 0); double prob = uniformRV->GetValue (0, 1); diff --git a/model/lora-channel.cc b/model/lora-channel.cc index 47ec5ca07a..308cd46829 100644 --- a/model/lora-channel.cc +++ b/model/lora-channel.cc @@ -116,7 +116,7 @@ LoraChannel::Send (Ptr< LoraPhy > sender, Ptr< Packet > packet, // Get the mobility model of the sender Ptr senderMobility = sender->GetMobility ()->GetObject (); - NS_ASSERT (senderMobility != 0); // Make sure it's available + NS_ASSERT (bool(senderMobility) != 0); // Make sure it's available NS_LOG_INFO ("Starting cycle over all " << m_phyList.size () << " PHYs"); NS_LOG_INFO ("Sender mobility: " << senderMobility->GetPosition ()); @@ -151,7 +151,7 @@ LoraChannel::Send (Ptr< LoraPhy > sender, Ptr< Packet > packet, // Get the id of the destination PHY to correctly format the context Ptr dstNetDevice = m_phyList[j]->GetDevice (); uint32_t dstNode = 0; - if (dstNetDevice != 0) + if (bool(dstNetDevice) != 0) { NS_LOG_INFO ("Getting node index from NetDevice, since it exists"); dstNode = dstNetDevice->GetNode ()->GetId (); diff --git a/model/lora-frame-header.h b/model/lora-frame-header.h index 960b18e81c..e3d0ebb9dc 100644 --- a/model/lora-frame-header.h +++ b/model/lora-frame-header.h @@ -328,7 +328,7 @@ LoraFrameHeader::GetMacCommand () std::list< Ptr< MacCommand> >::const_iterator it; for (it = m_macCommands.begin (); it != m_macCommands.end (); ++it) { - if ((*it)->GetObject () != 0) + if (bool((*it)->GetObject ()) != 0) { return (*it)->GetObject (); } diff --git a/model/lora-net-device.cc b/model/lora-net-device.cc index 17d62c88eb..cbadd176b9 100644 --- a/model/lora-net-device.cc +++ b/model/lora-net-device.cc @@ -99,7 +99,7 @@ LoraNetDevice::CompleteConfig (void) NS_LOG_FUNCTION_NOARGS (); // Verify we have all the necessary pieces - if (m_mac == 0 || m_phy == 0 || m_node == 0 || m_configComplete) + if (bool(m_mac) == 0 || bool(m_phy) == 0 || bool(m_node) == 0 || m_configComplete) { return; } @@ -114,7 +114,7 @@ LoraNetDevice::Send (Ptr packet) NS_LOG_FUNCTION (this << packet); // Send the packet to the MAC layer, if it exists - NS_ASSERT (m_mac != 0); + NS_ASSERT (bool(m_mac) != 0); m_mac->Send (packet); } @@ -195,7 +195,7 @@ LoraNetDevice::IsLinkUp (void) const { NS_LOG_FUNCTION (this); - return m_phy != 0; + return bool(m_phy) != 0; } void diff --git a/model/lora-phy.cc b/model/lora-phy.cc index b4b78ce8da..415f8ff030 100644 --- a/model/lora-phy.cc +++ b/model/lora-phy.cc @@ -110,7 +110,7 @@ LoraPhy::GetMobility (void) // If there is a mobility model associated to this PHY, take the mobility from // there - if (m_mobility != 0) + if (bool(m_mobility) != 0) { return m_mobility; } diff --git a/model/network-server.cc b/model/network-server.cc index c3150ff4f1..5b9b65ee30 100644 --- a/model/network-server.cc +++ b/model/network-server.cc @@ -88,7 +88,7 @@ NetworkServer::AddGateway (Ptr gateway, Ptr netDevice) for (uint32_t i = 0; i < gateway->GetNDevices (); i++) { p2pNetDevice = gateway->GetDevice (i)->GetObject (); - if (p2pNetDevice != 0) + if (bool(p2pNetDevice) != 0) { // We found a p2pNetDevice on the gateway break; @@ -98,7 +98,7 @@ NetworkServer::AddGateway (Ptr gateway, Ptr netDevice) // Get the gateway's LoRa MAC layer (assumes gateway's MAC is configured as first device) Ptr gwMac = gateway->GetDevice (0)->GetObject ()-> GetMac ()->GetObject (); - NS_ASSERT (gwMac != 0); + NS_ASSERT (bool(gwMac) != 0); // Get the Address Address gatewayAddress = p2pNetDevice->GetAddress (); @@ -134,7 +134,7 @@ NetworkServer::AddNode (Ptr node) for (uint32_t i = 0; i < node->GetNDevices (); i++) { loraNetDevice = node->GetDevice (i)->GetObject (); - if (loraNetDevice != 0) + if (bool(loraNetDevice) != 0) { // We found a LoraNetDevice on the node break; diff --git a/model/one-shot-sender.cc b/model/one-shot-sender.cc index cdf9ae9d5a..6d6aea7b8e 100644 --- a/model/one-shot-sender.cc +++ b/model/one-shot-sender.cc @@ -83,13 +83,13 @@ OneShotSender::StartApplication (void) NS_LOG_FUNCTION (this); // Make sure we have a MAC layer - if (m_mac == 0) + if (bool(m_mac) == 0) { // Assumes there's only one device Ptr loraNetDevice = m_node->GetDevice (0)->GetObject (); m_mac = loraNetDevice->GetMac (); - NS_ASSERT (m_mac != 0); + NS_ASSERT (bool(m_mac) != 0); } // Schedule the next SendPacket event diff --git a/model/periodic-sender.cc b/model/periodic-sender.cc index d34ff3c1c2..7d1fe2b0f7 100644 --- a/model/periodic-sender.cc +++ b/model/periodic-sender.cc @@ -133,13 +133,13 @@ PeriodicSender::StartApplication (void) NS_LOG_FUNCTION (this); // Make sure we have a MAC layer - if (m_mac == 0) + if (bool(m_mac) == 0) { // Assumes there's only one device Ptr loraNetDevice = m_node->GetDevice (0)->GetObject (); m_mac = loraNetDevice->GetMac (); - NS_ASSERT (m_mac != 0); + NS_ASSERT (bool(m_mac) != 0); } // Schedule the next SendPacket event diff --git a/wscript b/wscript deleted file mode 100644 index e1c1e78ff7..0000000000 --- a/wscript +++ /dev/null @@ -1,130 +0,0 @@ -# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- - -# def options(opt): -# pass - -# def configure(conf): -# conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H') - -def build(bld): - module = bld.create_ns3_module('lorawan', ['core', 'network', - 'propagation', 'mobility', - 'point-to-point', 'energy', - 'buildings']) - module.source = [ - 'model/lora-net-device.cc', - 'model/lorawan-mac.cc', - 'model/lora-phy.cc', - 'model/building-penetration-loss.cc', - 'model/correlated-shadowing-propagation-loss-model.cc', - 'model/lora-channel.cc', - 'model/lora-interference-helper.cc', - 'model/gateway-lorawan-mac.cc', - 'model/end-device-lorawan-mac.cc', - 'model/class-a-end-device-lorawan-mac.cc', - 'model/gateway-lora-phy.cc', - 'model/end-device-lora-phy.cc', - 'model/simple-end-device-lora-phy.cc', - 'model/simple-gateway-lora-phy.cc', - 'model/sub-band.cc', - 'model/logical-lora-channel.cc', - 'model/logical-lora-channel-helper.cc', - 'model/periodic-sender.cc', - 'model/one-shot-sender.cc', - 'model/forwarder.cc', - 'model/lorawan-mac-header.cc', - 'model/lora-frame-header.cc', - 'model/mac-command.cc', - 'model/lora-device-address.cc', - 'model/lora-device-address-generator.cc', - 'model/lora-tag.cc', - 'model/network-server.cc', - 'model/network-status.cc', - 'model/network-controller.cc', - 'model/network-controller-components.cc', - 'model/network-scheduler.cc', - 'model/end-device-status.cc', - 'model/gateway-status.cc', - 'model/lora-radio-energy-model.cc', - 'model/lora-tx-current-model.cc', - 'model/lora-utils.cc', - 'model/adr-component.cc', - 'model/hex-grid-position-allocator.cc', - 'helper/lora-radio-energy-model-helper.cc', - 'helper/lora-helper.cc', - 'helper/lora-phy-helper.cc', - 'helper/lorawan-mac-helper.cc', - 'helper/periodic-sender-helper.cc', - 'helper/one-shot-sender-helper.cc', - 'helper/forwarder-helper.cc', - 'helper/network-server-helper.cc', - 'helper/lora-packet-tracker.cc', - 'test/utilities.cc', - ] - - module_test = bld.create_ns3_module_test_library('lorawan') - module_test.source = [ - 'test/lorawan-test-suite.cc', - 'test/network-status-test-suite.cc', - 'test/network-scheduler-test-suite.cc', - 'test/network-server-test-suite.cc', - ] - - headers = bld(features='ns3header') - headers.module = 'lorawan' - headers.source = [ - 'model/lora-net-device.h', - 'model/lorawan-mac.h', - 'model/lora-phy.h', - 'model/building-penetration-loss.h', - 'model/correlated-shadowing-propagation-loss-model.h', - 'model/lora-channel.h', - 'model/lora-interference-helper.h', - 'model/gateway-lorawan-mac.h', - 'model/end-device-lorawan-mac.h', - 'model/class-a-end-device-lorawan-mac.h', - 'model/gateway-lora-phy.h', - 'model/end-device-lora-phy.h', - 'model/simple-end-device-lora-phy.h', - 'model/simple-gateway-lora-phy.h', - 'model/sub-band.h', - 'model/logical-lora-channel.h', - 'model/logical-lora-channel-helper.h', - 'model/periodic-sender.h', - 'model/one-shot-sender.h', - 'model/forwarder.h', - 'model/lorawan-mac-header.h', - 'model/lora-frame-header.h', - 'model/mac-command.h', - 'model/lora-device-address.h', - 'model/lora-device-address-generator.h', - 'model/lora-tag.h', - 'model/network-server.h', - 'model/network-status.h', - 'model/network-controller.h', - 'model/network-controller-components.h', - 'model/network-scheduler.h', - 'model/end-device-status.h', - 'model/gateway-status.h', - 'model/lora-radio-energy-model.h', - 'model/lora-tx-current-model.h', - 'model/lora-utils.h', - 'model/adr-component.h', - 'model/hex-grid-position-allocator.h', - 'helper/lora-radio-energy-model-helper.h', - 'helper/lora-helper.h', - 'helper/lora-phy-helper.h', - 'helper/lorawan-mac-helper.h', - 'helper/periodic-sender-helper.h', - 'helper/one-shot-sender-helper.h', - 'helper/forwarder-helper.h', - 'helper/network-server-helper.h', - 'helper/lora-packet-tracker.h', - 'test/utilities.h', - ] - - if bld.env.ENABLE_EXAMPLES: - bld.recurse('examples') - - # Comment to disable python bindings - # bld.ns3_python_bindings()