\r
#include "TestAndMeasurement.h"\r
\r
+/** Contains the (usually static) capabilities of the TMC device. This table is requested by the\r
+ * host upon enumeration to give it information on what features of the Test and Measurement USB\r
+ * Class the device supports.\r
+ */\r
+TMC_Capabilities_t Capabilities =\r
+ {\r
+ .Status = TMC_REQUEST_STATUS_SUCCESS,\r
+ .TMCVersion = VERSION_BCD(1.00),\r
+ \r
+ .Interface =\r
+ {\r
+ .ListenOnly = false,\r
+ .TalkOnly = false,\r
+ .PulseIndicateSupported = true,\r
+ },\r
+\r
+ .Device =\r
+ {\r
+ .SupportsAbortINOnMatch = false,\r
+ },\r
+ };\r
+\r
+\r
/** Main program entry point. This routine contains the overall program flow, including initial\r
* setup of all components and the main program loop.\r
*/\r
case Req_GetCapabilities:\r
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- \r
+ /* Acknowledge the SETUP packet, ready for data transfer */\r
+ Endpoint_ClearSETUP();\r
+ \r
+ /* Write the device capabilities to the control endpoint */\r
+ Endpoint_Write_Control_Stream_LE(&Capabilities, sizeof(TMC_Capabilities_t));\r
+ \r
+ /* Finalize the stream transfer to send the last packet or clear the host abort */\r
+ Endpoint_ClearOUT();\r
}\r
\r
break;\r
/* Device must be connected and configured for the task to run */\r
if (USB_DeviceState != DEVICE_STATE_Configured)\r
return;\r
+ \r
+ Endpoint_SelectEndpoint(TMC_OUT_EPNUM);\r
+ \r
+ if (Endpoint_IsOUTReceived())\r
+ {\r
+ // TEMP - Indicate data received\r
+ LEDs_SetAllLEDs(LEDS_ALL_LEDS);\r
+ Endpoint_ClearOUT();\r
+ }\r
}\r