From 787c891702a9e6f4ddfe4f4c04457d7304fd21d5 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 21 Jul 2020 21:00:11 +0700 Subject: [PATCH] add note for MS OS 1.0 Descriptor at 0xEE --- examples/device/cdc_dual_ports/src/usb_descriptors.c | 4 +++- examples/device/cdc_msc/src/usb_descriptors.c | 4 +++- examples/device/cdc_msc_freertos/src/usb_descriptors.c | 4 +++- examples/device/dfu_rt/src/usb_descriptors.c | 4 +++- examples/device/dynamic_configuration/src/usb_descriptors.c | 4 +++- examples/device/hid_composite/src/usb_descriptors.c | 4 +++- examples/device/hid_composite_freertos/src/usb_descriptors.c | 4 +++- examples/device/hid_generic_inout/src/usb_descriptors.c | 4 +++- examples/device/midi_test/src/usb_descriptors.c | 4 +++- examples/device/msc_dual_lun/src/usb_descriptors.c | 4 +++- examples/device/net_lwip_webserver/src/usb_descriptors.c | 4 +++- examples/device/usbtmc/src/usb_descriptors.c | 4 +++- examples/device/webusb_serial/src/usb_descriptors.c | 4 +++- 13 files changed, 39 insertions(+), 13 deletions(-) diff --git a/examples/device/cdc_dual_ports/src/usb_descriptors.c b/examples/device/cdc_dual_ports/src/usb_descriptors.c index f23e42036..8e19678e5 100644 --- a/examples/device/cdc_dual_ports/src/usb_descriptors.c +++ b/examples/device/cdc_dual_ports/src/usb_descriptors.c @@ -170,7 +170,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) chr_count = 1; }else { - // Convert ASCII string into UTF-16 + // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors. + // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL; @@ -180,6 +181,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) chr_count = strlen(str); if ( chr_count > 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i (TU_ARRAY_SIZE(_desc_str) - 1)) chr_count = TU_ARRAY_SIZE(_desc_str) - 1; + // Convert ASCII string into UTF-16 for (unsigned int i=0; i 31 ) chr_count = 31; + // Convert ASCII string into UTF-16 for(uint8_t i=0; i