Remove ClearPipeStall routine from the StillImageHost demo, as there is now a version...
[pub/USBasp.git] / Demos / Host / Incomplete / PrinterHost / Lib / PrinterCommands.c
index 075b2d6..87651e9 100644 (file)
 \r
 #include "PrinterCommands.h"\r
 \r
 \r
 #include "PrinterCommands.h"\r
 \r
-uint8_t Printer_SendData(char* PrinterCommands)\r
+/** Sends the given data directly to the printer via the data endpoints, for the sending of print commands in printer\r
+ *  languages accepted by the attached printer (e.g. PCL).\r
+ *\r
+ *  \param[in] PrinterCommands  Pointer to a structure containing the commands and length of the data to send\r
+ *\r
+ *  \return A value from the Pipe_Stream_RW_ErrorCodes_t enum\r
+ */\r
+uint8_t Printer_SendData(Printer_Data_t* PrinterCommands)\r
 {\r
        uint8_t ErrorCode;\r
 \r
        Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
        \r
 {\r
        uint8_t ErrorCode;\r
 \r
        Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
        \r
-       if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands, strlen(PrinterCommands))) != PIPE_RWSTREAM_NoError)\r
+       if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands->Data, PrinterCommands->Length)) != PIPE_RWSTREAM_NoError)\r
          return ErrorCode;\r
 \r
        Pipe_ClearOUT();\r
          return ErrorCode;\r
 \r
        Pipe_ClearOUT();\r