Small cleanup

This commit is contained in:
Bart Sopers 2020-04-27 22:55:31 +02:00
parent 45ef41d1a3
commit b8f2fdc7a8

View file

@ -263,15 +263,13 @@ public class OmnipodCommunicationService extends RileyLinkCommunicationManager {
} }
private OmnipodPacket createAckPacket(PodState podState, Integer packetAddress, Integer messageAddress) { private OmnipodPacket createAckPacket(PodState podState, Integer packetAddress, Integer messageAddress) {
int pktAddress = podState.getAddress(); if(packetAddress == null) {
int msgAddress = podState.getAddress(); packetAddress = podState.getAddress();
if (packetAddress != null) {
pktAddress = packetAddress;
} }
if (messageAddress != null) { if(messageAddress == null) {
msgAddress = messageAddress; messageAddress = podState.getAddress();
} }
return new OmnipodPacket(pktAddress, PacketType.ACK, podState.getPacketNumber(), ByteUtil.getBytesFromInt(msgAddress)); return new OmnipodPacket(packetAddress, PacketType.ACK, podState.getPacketNumber(), ByteUtil.getBytesFromInt(messageAddress));
} }
private void ackUntilQuiet(PodState podState, Integer packetAddress, Integer messageAddress) { private void ackUntilQuiet(PodState podState, Integer packetAddress, Integer messageAddress) {