[omnikinverter] Remove org.apache.common (#14418)

Signed-off-by: lsiepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2023-02-19 21:19:09 +01:00 committed by GitHub
parent c3624e7397
commit 07aef8075c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,6 @@ import java.io.IOException;
import java.net.Socket;
import java.nio.ByteBuffer;
import org.apache.commons.lang3.ArrayUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
@ -55,7 +54,13 @@ public class OmnikInverter {
private byte[] generateMagicPacket() {
ByteBuffer serialByteBuffer = ByteBuffer.allocate(8).putInt(serialNumber).putInt(serialNumber);
byte[] serialBytes = serialByteBuffer.array();
ArrayUtils.reverse(serialBytes);
// reverse array
for (int i = 0; i < serialBytes.length / 2; i++) {
byte temp = serialBytes[i];
serialBytes[i] = serialBytes[serialBytes.length - i - 1];
serialBytes[serialBytes.length - i - 1] = temp;
}
byte checksumCount = 115;
for (byte b : serialBytes) {