Fork of https://developer.mbed.org/users/bscott/code/STM32_USBDevice/

Fork of STM32_USBDevice by Bradley Scott

Revision:
79:d28244984385
Parent:
76:eef92651f52f
--- a/USBDevice/USBDevice.cpp	Fri Oct 27 17:22:45 2017 +0200
+++ b/USBDevice/USBDevice.cpp	Wed Jul 25 14:04:48 2018 +0200
@@ -155,6 +155,24 @@
 #endif
             /* TODO: Support is optional, not implemented here */
             break;
+
+        case BOS_DESCRIPTOR:
+#ifdef DEBUG
+            printf("BOS descr\r\n");
+#endif
+            {
+                uint8_t *descriptor = bosDesc();
+                if (descriptor)
+                {
+                    /* Get wTotalLength */
+                    transfer.remaining = descriptor[2] | (descriptor[3] << 8);
+                    transfer.ptr = descriptor;
+                    transfer.direction = DEVICE_TO_HOST;
+                    success = true;
+                }
+            }
+            break;
+
         default:
 #ifdef DEBUG
             printf("ERROR\r\n");
@@ -835,7 +853,7 @@
 }
 
 
-bool USBDevice::write(uint8_t endpoint, uint8_t * buffer, uint32_t size, uint32_t maxSize)
+bool USBDevice::write(uint8_t endpoint, const uint8_t * buffer, uint32_t size, uint32_t maxSize)
 {
     EP_STATUS result;
 
@@ -876,7 +894,7 @@
 }
 
 
-bool USBDevice::writeNB(uint8_t endpoint, uint8_t * buffer, uint32_t size, uint32_t maxSize)
+bool USBDevice::writeNB(uint8_t endpoint, const uint8_t * buffer, uint32_t size, uint32_t maxSize)
 {
     EP_STATUS result;