aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-23 09:01:23 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-23 09:01:23 +0000
commit64937a62062368504cc9982d15a7d332566d8fac (patch)
tree98d98a143cfccdd6475d649de9cd0a54a8da9948 /Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
parentbb23e55f11a42f6214757483d010ebd24377caeb (diff)
downloadlufa-64937a62062368504cc9982d15a7d332566d8fac.tar.gz
lufa-64937a62062368504cc9982d15a7d332566d8fac.tar.bz2
lufa-64937a62062368504cc9982d15a7d332566d8fac.zip
MassStorageHost demo now retrieves Inquiry data from the device during enumeration, and prints the device's Vendor and Product IDs.
Diffstat (limited to 'Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c')
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
index 905077e81..79a559234 100644
--- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
+++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
@@ -191,7 +191,7 @@ void MassStorage_Task(void)
}
/* Print number of LUNs detected in the attached device */
- printf_P(PSTR("Total LUNs: %d.\r\n"), (MassStore_MaxLUNIndex + 1));
+ printf_P(PSTR("Total LUNs: %d - Using first LUN in device.\r\n"), (MassStore_MaxLUNIndex + 1));
/* Reset the Mass Storage device interface, ready for use */
if ((ErrorCode = MassStore_MassStorageReset()) != HOST_SENDCONTROL_Successful)
@@ -216,9 +216,20 @@ void MassStorage_Task(void)
break;
}
- puts_P(PSTR("Waiting until ready.."));
+ /* Get inquiry data from the device */
+ SCSI_Inquiry_Response_t InquiryData;
+ if (((ErrorCode = MassStore_Inquiry(0, &InquiryData)) != 0) || (SCSICommandStatus.Status != Command_Pass))
+ {
+ ShowDiskReadError(PSTR("Inquiry"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);
+ break;
+ }
+ /* Print vendor and product names of attached device */
+ printf_P(PSTR("Vendor: %s, Product: %s\r\n"), InquiryData.VendorID, InquiryData.ProductID);
+
/* Wait until disk ready */
+ puts_P(PSTR("Waiting until ready.."));
+
do
{
Serial_TxByte('.');