Hi,

I had a device (disk on key) and I try to send Inquiry command to the device
and then to get response from device.
My problem is I can not understand the buffer(o_buff) that came from my
device.


This is my code:

#define SCSI_OFF sizeof(struct sg_header)

/***************************************************************************
****************/
    sg_hd = (struct sg_header *) i_buff;
    sg_hd->reply_len   = SCSI_OFF + out_size;
    sg_hd->twelve_byte = (cmd_len ==12);
    sg_hd->result = 0;


    /* send command */
    status = write( fd[numOfDev], i_buff, SCSI_OFF + cmd_len + in_size );
    if ( status < 0 || status != SCSI_OFF + cmd_len + in_size ||
         sg_hd->result )
   {
        // some error happened 
        fprintf( stderr, "write(generic) result = 0x%x cmd = 0x%x\n", 
                    sg_hd->result, i_buff[SCSI_OFF] );
        printf("device num: %d ,write NO OK\n",numOfDev);

        return status;
    }
    else
         printf("OK\n");


    /* retrieve result */
    status = read( fd[numOfDev], o_buff, SCSI_OFF + out_size);

/***************************************************************************
****************/

When I try to print my o_buff (after read() operation ) I got something that
I can not understand.
I believe I had mistake with my write() function. 
What should I eneter in i_buff ???



thanks,
eyalz





----------------------------------------------------------------------------
                   Bringing you mounds of caffeinated joy
                   >>>     http://thinkgeek.com/sf    <<<

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to