git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Mon, 6 Dec 2021 11:15:59 +0000 (11:15 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Mon, 6 Dec 2021 11:15:59 +0000 (11:15 +0000)
server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java

index 96e8b8947f353a08959ab53fd6610b0daea08594..0a29c954e1736e5ee149046ec362e246331f101d 100644 (file)
@@ -2,20 +2,21 @@ package user.commons.nexio.server.protocol;
 \r
 import java.io.IOException;\r
 import java.nio.ByteBuffer;\r
-import java.nio.ByteOrder;\r
 \r
-public class PortStatusCommand extends Command{\r
+public class PortStatusCommand extends Command {\r
 \r
-       \r
        private final static byte[] PORT_STATUS = { (byte) 0x30, (byte) 0x05, (byte) 0x02 };\r
        private static final String INVALID_RESPONSE = "Invalid response length, response should be 1 byte, but we got 0";\r
-       \r
-       //Byte 1, Bit 1: IDS ADDED - New IDs have been added to the disk system by recording or \r
-       //transferring from an archive system, and the controller of the port has not yet asked for that list of the IDs.\r
-       public final static byte BIT_IDS_ADDED = (byte)2;\r
-       \r
-       //Byte 1, Bit 2: IDS DELETED - IDs have been deleted from the disk and the controller of the port has not yet asked     \r
-       public final static byte BIT_IDS_DELETED = (byte)4;\r
+\r
+       // Byte 1, Bit 1: IDS ADDED - New IDs have been added to the disk system by\r
+       // recording or\r
+       // transferring from an archive system, and the controller of the port has not\r
+       // yet asked for that list of the IDs.\r
+       public final static byte BIT_IDS_ADDED = (byte) 2;\r
+\r
+       // Byte 1, Bit 2: IDS DELETED - IDs have been deleted from the disk and the\r
+       // controller of the port has not yet asked\r
+       public final static byte BIT_IDS_DELETED = (byte) 4;\r
 \r
        public PortStatusCommand(Connection connection) {\r
                super(connection);\r
@@ -24,17 +25,16 @@ public class PortStatusCommand extends Command{
        public byte execute() throws IOException, ProtocolException {\r
 \r
                connection.write(PORT_STATUS);\r
-               //connection.write((byte)2);            //STATUS 2\r
+               // connection.write((byte)2); //STATUS 2\r
                connection.flush();\r
 \r
                byte[] buffer = new byte[1];\r
                int c = connection.read(buffer, 0, 1);\r
 \r
-               if(c < 1)\r
+               if (c < 1)\r
                        throw new ProtocolException(INVALID_RESPONSE);\r
 \r
                ByteBuffer bbuffer = ByteBuffer.wrap(buffer);\r
                return bbuffer.get();\r
        }\r
 }\r
-\r