use of me.retrodaredevil.solarthing.commands.packets.open.RequestHeartbeatPacket in project solarthing by wildmountainfarms.
the class RequestHeartbeatReceiver method receivePacketGroup.
@Override
public void receivePacketGroup(String sender, TargetPacketGroup packetGroup) {
Instant now = Instant.now();
for (Packet packet : packetGroup.getPackets()) {
if (packet instanceof RequestHeartbeatPacket) {
RequestHeartbeatPacket requestHeartbeatPacket = (RequestHeartbeatPacket) packet;
HeartbeatData data = requestHeartbeatPacket.getData();
OpenSource openSource = new OpenSource(sender, packetGroup.getDateMillis(), requestHeartbeatPacket, requestHeartbeatPacket.getUniqueString());
ExecutionReason executionReason = new OpenSourceExecutionReason(openSource);
HeartbeatPacket heartbeatPacket = new ImmutableHeartbeatPacket(data, executionReason);
eventPacketListReceiverHandler.uploadSimple(now, Arrays.asList(heartbeatPacket));
}
}
}
Aggregations