X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/786479faf0605d610c93041191ee5bd6d020ccf9..211712d66d6949941141964341bb937bf1422636:/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.c?ds=sidebyside diff --git a/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.c index 075b2d601..87651e906 100644 --- a/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.c +++ b/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.c @@ -30,14 +30,21 @@ #include "PrinterCommands.h" -uint8_t Printer_SendData(char* PrinterCommands) +/** Sends the given data directly to the printer via the data endpoints, for the sending of print commands in printer + * languages accepted by the attached printer (e.g. PCL). + * + * \param[in] PrinterCommands Pointer to a structure containing the commands and length of the data to send + * + * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum + */ +uint8_t Printer_SendData(Printer_Data_t* PrinterCommands) { uint8_t ErrorCode; Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE); Pipe_Unfreeze(); - if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands, strlen(PrinterCommands))) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands->Data, PrinterCommands->Length)) != PIPE_RWSTREAM_NoError) return ErrorCode; Pipe_ClearOUT();