Skip to content
Snippets Groups Projects
Commit 278bcd9e authored by brutzman's avatar brutzman
Browse files

replace hardwired value with defined constant

parent bd8ee028
No related branches found
No related tags found
No related merge requests found
...@@ -68,8 +68,8 @@ public class UdpSender ...@@ -68,8 +68,8 @@ public class UdpSender
for (int index = 1; index <= TOTAL_PACKETS_TO_SEND; index++) // avoid infinite send loops in code, they can be hard to kill! for (int index = 1; index <= TOTAL_PACKETS_TO_SEND; index++) // avoid infinite send loops in code, they can be hard to kill!
{ {
packetID++; // increment counter, prefer using explicit value to index packetID++; // increment counter, prefer using explicit value to index
value = 100 - packetID; // countdown value = TOTAL_PACKETS_TO_SEND - packetID; // countdown
boolean isPacketIdEvenParity = ((packetID % 2) == 0); // % is modulo operator; result 0 is even parity, 1 is odd parity boolean isPacketIdEvenParity = ((packetID % 2) == 0); // % is modulo operator; result 0 is even parity, 1 is odd parity
// values of interest follow. order and types of what was sent must match what you are reading! // values of interest follow. order and types of what was sent must match what you are reading!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment