Cleaner solution to the PrinterHost data send routine problem of embedded NULLs ...
[pub/USBasp.git] / Demos / Host / Incomplete / PrinterHost / Lib / PrinterCommands.c
index 03d3070..87651e9 100644 (file)
 /** 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 the input buffer containing the printer data to send\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(char* PrinterCommands, uint16_t DataLength)\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
-       if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands, DataLength)) != 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