public static final int getReponseCodeFor ( final ErrorType errorType , final SenseDataFormat senseDataFormat ) { if ( senseDataFormat == SenseDataFormat . FIXED ) { if ( errorType == ErrorType . CURRENT ) return 0x70 ; else // errorType == DEFERRED return 0x71 ; } else { // senseDataFormat == DESCRIPTOR if ( errorType == ErrorType . CURRENT ) return 0x72 ; else // errorType == DEFERRED return 0x73 ; } /* * Response codes 0x74 to 0x7E are reserved. Response code 0x7f is vendor specific. */ }
Returns the proper response code for the given error type and sense data format .