\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
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