/* test_unit_ready.c /*
#include 
#include 
#include 
#include 
#include "send_scsi_cmd.h"
#define SENSE_BYTES	18	// La dimensione del buffer di sense.
int main(int argc, char *argv[])
{
// Sintassi: nome del device, numero dell'unità.
ULONG unit;
if(argc > 2)
	{
	if(sscanf(argv[2], "%lu", &unit))
		{
		WORD retval;
		UBYTE command[6] = { SCSI_TEST_UNIT_READY, 0, 0, 0, 0, 0};
		UBYTE sensereturn[SENSE_BYTES];
		struct sizedbuffer cmd, data, sense;
		cmd.buf		= command;
		cmd.len		= 6;
		data.buf	= NULL;
		data.len	= 0; // Nessuna fase dati!!
		sense.buf	= sensereturn;
		sense.len	= SENSE_BYTES;
		retval = Send_SCSI_CMD(	argv[1],
					unit,
					0L,
					&cmd,
					&data,
					&sense,
					0,
					SCSIF_AUTOSENSE
					);
		if((retval >> 8) == HFERR_BadStatus) // CHECK_CONDITION
			printf("Unità non presente!\n");
		else if(retval >> 8)
			printf("Errore all'apertura dell'unità: %u\n", (retval >> 8));
		else if(retval == 0)
			printf("Unità presente.\n");
		else printf("Stato sconosciuto: %x\n", retval);
		}
	}
return 0;
}