X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/3b99abb5fcc4e92142d02b1a115fed8d5028596b..bc3db793e9867567bc881942845c7d84c2b09e37:/LUFA/Drivers/USB/Core/HostStandardReq.h diff --git a/LUFA/Drivers/USB/Core/HostStandardReq.h b/LUFA/Drivers/USB/Core/HostStandardReq.h index 92b37f8a6..d076a8a66 100644 --- a/LUFA/Drivers/USB/Core/HostStandardReq.h +++ b/LUFA/Drivers/USB/Core/HostStandardReq.h @@ -69,7 +69,7 @@ */ #define USB_HOST_TIMEOUT_MS 1000 #endif - + /* Enums: */ /** Enum for the \ref USB_Host_SendControlRequest() return code, indicating the reason for the error * if the transfer of the request is unsuccessful. @@ -101,7 +101,7 @@ * \ingroup Group_Host */ extern uint8_t USB_Host_ConfigurationNumber; - + /* Function Prototypes: */ /** Sends the request stored in the \ref USB_ControlRequest global structure to the attached device, * and transfers the data stored in the buffer to the device, or from the device to the buffer @@ -130,7 +130,7 @@ * \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result. */ uint8_t USB_Host_SetDeviceConfiguration(const uint8_t ConfigNumber); - + /** Sends a GET CONFIGURATION standard request to the attached device, to retrieve the currently selected * device configuration index. * @@ -234,11 +234,12 @@ * * \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result. */ + static inline uint8_t USB_Host_GetDeviceDescriptor(USB_Descriptor_Device_t* const DeviceDescriptorPtr) ATTR_NON_NULL_PTR_ARG(1); static inline uint8_t USB_Host_GetDeviceDescriptor(USB_Descriptor_Device_t* const DeviceDescriptorPtr) { return USB_Host_GetDescriptor(DTYPE_Device, 0, DeviceDescriptorPtr, sizeof(USB_Descriptor_Device_t)); } - + /** Sends a GET DESCRIPTOR standard request to the attached device, requesting the string descriptor * of the specified index. This can be used to easily retrieve string descriptors from the device by * index, after the index is obtained from the Device or Configuration descriptors. This is a convenience @@ -257,6 +258,9 @@ */ static inline uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index, void* const Buffer, + const uint8_t BufferLength) ATTR_NON_NULL_PTR_ARG(2); + static inline uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index, + void* const Buffer, const uint8_t BufferLength) { return USB_Host_GetDescriptor(DTYPE_String, Index, Buffer, BufferLength);