summaryrefslogtreecommitdiff
path: root/examples/device/msc_dual_lun
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-03 23:46:01 +0700
committerhathach <[email protected]>2019-05-03 23:46:01 +0700
commitfae9aba68f7fb2cb5309b21933bcc0d3fdc480e0 (patch)
tree2ceec38bc2755051c9f9dbeb1ff1c791181581b6 /examples/device/msc_dual_lun
parent49ad6fe0ac0fc5479abac1b2d2d9174a6aedb663 (diff)
add tud_msc_inquiry_cb() remove CFG_TUD_MSC_VENDOR/PRODUCT/PRODUCT_REV
Diffstat (limited to 'examples/device/msc_dual_lun')
-rw-r--r--examples/device/msc_dual_lun/src/msc_disk_dual.c14
-rw-r--r--examples/device/msc_dual_lun/src/tusb_config.h9
2 files changed, 14 insertions, 9 deletions
diff --git a/examples/device/msc_dual_lun/src/msc_disk_dual.c b/examples/device/msc_dual_lun/src/msc_disk_dual.c
index 48c8f2409..780705db2 100644
--- a/examples/device/msc_dual_lun/src/msc_disk_dual.c
+++ b/examples/device/msc_dual_lun/src/msc_disk_dual.c
@@ -219,6 +219,20 @@ void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_siz
*block_size = DISK_BLOCK_SIZE;
}
+// Invoked when received SCSI_CMD_INQUIRY
+// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
+void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4])
+{
+ (void) lun; // use same ID for both LUNs
+
+ const char vid[] = "TinyUSB";
+ const char pid[] = "Mass Storage";
+ const char rev[] = "1.0";
+
+ memcpy(vendor_id , vid, strlen(vid));
+ memcpy(product_id , pid, strlen(pid));
+ memcpy(product_rev, rev, strlen(rev));
+}
// Callback invoked when received READ10 command.
// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
diff --git a/examples/device/msc_dual_lun/src/tusb_config.h b/examples/device/msc_dual_lun/src/tusb_config.h
index 492eba5f1..939919739 100644
--- a/examples/device/msc_dual_lun/src/tusb_config.h
+++ b/examples/device/msc_dual_lun/src/tusb_config.h
@@ -81,15 +81,6 @@
// Buffer size of Device Mass storage
#define CFG_TUD_MSC_BUFSIZE 512
-// Vendor name included in Inquiry response, max 8 bytes
-#define CFG_TUD_MSC_VENDOR "tinyusb"
-
-// Product name included in Inquiry response, max 16 bytes
-#define CFG_TUD_MSC_PRODUCT "tusb msc"
-
-// Product revision string included in Inquiry response, max 4 bytes
-#define CFG_TUD_MSC_PRODUCT_REV "1.0"
-
#ifdef __cplusplus
}
#endif