*\r
* \return A value from the USB_Host_SendControlErrorCodes_t enum\r
*/\r
-uint8_t Printer_GetDeviceID(char* DeviceIDString, uint8_t BufferSize)\r
+uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)\r
{\r
uint8_t ErrorCode = HOST_SENDCONTROL_Successful;\r
uint16_t DeviceIDStringLength;\r
if (DeviceIDStringLength > BufferSize)\r
DeviceIDStringLength = BufferSize;\r
\r
- USB_ControlRequest.wLength = (DeviceIDStringLength - 1);\r
+ USB_ControlRequest.wLength = DeviceIDStringLength;\r
\r
if ((ErrorCode = USB_Host_SendControlRequest(DeviceIDString)) != HOST_SENDCONTROL_Successful)\r
return ErrorCode;\r
- \r
- DeviceIDString[DeviceIDStringLength] = 0x00;\r
+ \r
+ /* Move string back two characters to remove the string length value from the start of the array */\r
+ memmove(&DeviceIDString[0], &DeviceIDString[2], DeviceIDStringLength - 2);\r
+\r
+ DeviceIDString[DeviceIDStringLength - 2] = 0x00;\r
\r
return HOST_SENDCONTROL_Successful;\r
}\r