From 1c70118a1f300550a7cdbf9a5ec5b94fc5803414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Po=C5=82ys?= Date: Wed, 11 Apr 2018 14:32:23 +0200 Subject: [PATCH] Update SimpleLoRaApp.cc Check if delay between packets is not set as constant and below the time need for transmission. --- src/LoRaApp/SimpleLoRaApp.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/LoRaApp/SimpleLoRaApp.cc b/src/LoRaApp/SimpleLoRaApp.cc index 70fb51e..7e0e1aa 100644 --- a/src/LoRaApp/SimpleLoRaApp.cc +++ b/src/LoRaApp/SimpleLoRaApp.cc @@ -114,8 +114,16 @@ void SimpleLoRaApp::handleMessage(cMessage *msg) if(loRaSF == 10) time = 49.3568; if(loRaSF == 11) time = 85.6064; if(loRaSF == 12) time = 171.2128; + simtime_t prevTimeToNextPacket = par("timeToNextPacket"); + short int isTTNPconstant = 0; do { timeToNextPacket = par("timeToNextPacket"); + if (timeToNextPacket == prevTimeToNextPacket) + { + isTTNPconstant++; + if (isTTNPconstant > 3) + error("timeToNextPacket is constant and shorter than packet transmission time"); + } //if(timeToNextPacket < 3) error("Time to next packet must be grater than 3"); } while(timeToNextPacket <= time); sendMeasurements = new cMessage("sendMeasurements");