Fixed PrinterHost demo returning invalid Device ID data when the attached device does not have a device ID (thanks to Andrei Krainev).

pull/1469/head
Dean Camera 15 years ago
parent 409c49f057
commit e57e08c672

@ -77,7 +77,7 @@ uint8_t Printer_SendData(void* PrinterCommands, uint16_t CommandSize)
uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)
{
uint8_t ErrorCode = HOST_SENDCONTROL_Successful;
uint16_t DeviceIDStringLength;
uint16_t DeviceIDStringLength = 0;
USB_ControlRequest = (USB_Request_Header_t)
{
@ -92,6 +92,12 @@ uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)
if ((ErrorCode = USB_Host_SendControlRequest(&DeviceIDStringLength)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
if (!(DeviceIDStringLength))
{
DeviceIDString[0] = 0x00;
return HOST_SENDCONTROL_Successful;
}
DeviceIDStringLength = SwapEndian_16(DeviceIDStringLength);

@ -97,7 +97,7 @@
*/
typedef struct
{
uint8_t ReponseCode;
uint8_t ResponseCode;
uint8_t SegmentNumber;

@ -9,6 +9,16 @@
* \section Sec_ChangeLogXXXXXX Version XXXXXX
*
* <b>New:</b>
*
* <b>Changed:</b>
*
* <b>Fixed:</b>
* - Fixed PrinterHost demo returning invalid Device ID data when the attached device does not have a
* device ID (thanks to Andrei Krainev)
*
* \section Sec_ChangeLog090924 Version 090924
*
* <b>New:</b>
* - Added new host mode class drivers and matching demos to the library for rapid application development
* - Added flag to the HID report parser to indicate if a device has multiple reports
* - Added new EVENT_USB_Device_StartOfFrame() event, controlled by the new USB_Device_EnableSOFEvents() and

@ -12,10 +12,10 @@
* or post your suggestion as an enhancement request to the project bug tracker.
*
* <b>Targeted for This Release (SVN Development Only):</b>
* - N/A
* - Add hub support to match Atmel's stack
* - Add ability to get number of bytes not written with pipe/endpoint write routines after an error
*
* <b>Targeted for Future Releases:</b>
* - Add hub support to match Atmel's stack
* - Add standardized descriptor names to device and host class driver structures
* - Remake AVRStudio project files
* - Add detailed overviews of how each demo works

@ -12,6 +12,8 @@
*
* \section Sec_MigrationXXXXXX Migrating from 090810 to XXXXXX
*
* \section Sec_Migration090924 Migrating from 090810 to 090924
*
* <b>Non-USB Library Components</b>
* - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library.
* - The \ref SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See

Loading…
Cancel
Save