From: Sweidan Omar Date: Mon, 6 Dec 2021 11:15:59 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=37eeb0af5144e190469f1421fe0b1efdf2d121e6;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32447 --- diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java index 96e8b894..0a29c954 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java @@ -2,20 +2,21 @@ package user.commons.nexio.server.protocol; import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.ByteOrder; -public class PortStatusCommand extends Command{ +public class PortStatusCommand extends Command { - private final static byte[] PORT_STATUS = { (byte) 0x30, (byte) 0x05, (byte) 0x02 }; private static final String INVALID_RESPONSE = "Invalid response length, response should be 1 byte, but we got 0"; - - //Byte 1, Bit 1: IDS ADDED - New IDs have been added to the disk system by recording or - //transferring from an archive system, and the controller of the port has not yet asked for that list of the IDs. - public final static byte BIT_IDS_ADDED = (byte)2; - - //Byte 1, Bit 2: IDS DELETED - IDs have been deleted from the disk and the controller of the port has not yet asked - public final static byte BIT_IDS_DELETED = (byte)4; + + // Byte 1, Bit 1: IDS ADDED - New IDs have been added to the disk system by + // recording or + // transferring from an archive system, and the controller of the port has not + // yet asked for that list of the IDs. + public final static byte BIT_IDS_ADDED = (byte) 2; + + // Byte 1, Bit 2: IDS DELETED - IDs have been deleted from the disk and the + // controller of the port has not yet asked + public final static byte BIT_IDS_DELETED = (byte) 4; public PortStatusCommand(Connection connection) { super(connection); @@ -24,17 +25,16 @@ public class PortStatusCommand extends Command{ public byte execute() throws IOException, ProtocolException { connection.write(PORT_STATUS); - //connection.write((byte)2); //STATUS 2 + // connection.write((byte)2); //STATUS 2 connection.flush(); byte[] buffer = new byte[1]; int c = connection.read(buffer, 0, 1); - if(c < 1) + if (c < 1) throw new ProtocolException(INVALID_RESPONSE); ByteBuffer bbuffer = ByteBuffer.wrap(buffer); return bbuffer.get(); } } -