this software.\r
*/\r
\r
+/** \file\r
+ *\r
+ * Printer Device commands, to send/recieve data to and from an attached USB\r
+ * printer, and to send and receive Printer Class control requests.\r
+ */\r
+\r
#include "PrinterCommands.h"\r
\r
/** Sends the given data directly to the printer via the data endpoints, for the sending of print commands in printer\r
return ErrorCode;\r
\r
Pipe_ClearOUT();\r
- while (!(Pipe_IsOUTReady()));\r
+ while (!(Pipe_IsOUTReady()))\r
+ {\r
+ if (USB_HostState == HOST_STATE_Unattached)\r
+ return PIPE_RWSTREAM_DeviceDisconnected;\r
+ }\r
\r
Pipe_Freeze();\r
\r
wIndex: 0,\r
wLength: sizeof(DeviceIDStringLength),\r
};\r
+ \r
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
\r
if ((ErrorCode = USB_Host_SendControlRequest(&DeviceIDStringLength)) != HOST_SENDCONTROL_Successful)\r
return ErrorCode;\r
wLength: sizeof(uint8_t),\r
};\r
\r
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
+\r
return USB_Host_SendControlRequest(PortStatus);\r
}\r
\r
wLength: 0,\r
};\r
\r
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
+\r
return USB_Host_SendControlRequest(NULL);\r
}\r
\r