Selaa lähdekoodia

Small fixes

* CopyPast comment fix in Packet
* Fixes MQTT:Ping response sending request packet
Andreas T. Meyer-Berg 5 vuotta sitten
vanhempi
commit
456f852a21

+ 1 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/Packet.java

@@ -48,7 +48,7 @@ public abstract class Packet {
 	/**
 	 * Returns the Payload as String
 	 * 
-	 * @return Textual Representation of the Package
+	 * @return Textual Representation of the Payload
 	 */
 	public abstract String getPayload();
 

+ 2 - 2
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/protocols/MQTT_protocol.java

@@ -137,7 +137,7 @@ public class MQTT_protocol implements Protocol {
 			if(dest != null){
 				returnPackets.add(new MQTT_packet(MQTT_packet.PINGREQ, timestep, port, dest));
 				if(dest.getStatus()!=Port.CLOSED)
-					returnPackets.add(new MQTT_packet(MQTT_packet.PINGREQ, timestep, dest, port));
+					returnPackets.add(new MQTT_packet(MQTT_packet.PINGRESP, timestep, dest, port));
 			}
 		}
 		if(subs.contains(port)||pubSubs.contains(port)){
@@ -210,7 +210,7 @@ public class MQTT_protocol implements Protocol {
 		if(Math.random() < 0.05 && port != broker){
 			returnPackets.add(new MQTT_packet(MQTT_packet.PINGREQ, timestep, port, broker));
 			if(port.getStatus()!=Port.CLOSED)
-				returnPackets.add(new MQTT_packet(MQTT_packet.PINGREQ, timestep, broker, port));
+				returnPackets.add(new MQTT_packet(MQTT_packet.PINGRESP, timestep, broker, port));
 		}
 		return returnPackets;
 	}