*\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum\r
*/\r
-uint8_t Printer_SendData(char* PrinterCommands)\r
+uint8_t Printer_SendData(char* PrinterCommands, uint16_t DataLength)\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, DataLength)) != PIPE_RWSTREAM_NoError)\r
return ErrorCode;\r
\r
Pipe_ClearOUT();\r
#define PRINTER_DATA_OUT_PIPE 2\r
\r
/* Function Prototypes: */\r
- uint8_t Printer_SendData(char* PrinterCommands);\r
+ uint8_t Printer_SendData(char* PrinterCommands, uint16_t DataLength);\r
uint8_t Printer_GetDeviceID(char* DeviceIDString, uint8_t BufferSize);\r
uint8_t Printer_GetPortStatus(uint8_t* PortStatus);\r
uint8_t Printer_SoftReset(void);\r
char PCL_Test_Page[] = "\033%-12345X\033E LUFA PCL Test Page \033E\033%-12345X";\r
// char ESCP2_Test_Page[] = "\033@\033i\001\033X\001\060\000\r\nLUFA ESCP/2 Test Page\r\n";\r
\r
- printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), strlen(PCL_Test_Page));\r
+ printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), (sizeof(PCL_Test_Page) - 1));\r
\r
- if ((ErrorCode = Printer_SendData(PCL_Test_Page)) != PIPE_RWSTREAM_NoError)\r
+ if ((ErrorCode = Printer_SendData(PCL_Test_Page, (sizeof(PCL_Test_Page) - 1))) != PIPE_RWSTREAM_NoError)\r
{\r
puts_P(PSTR(ESC_FG_RED "Error Sending Test Page.\r\n"));\r
printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);\r
/* Loop through the entire unicode string */\r
while (CharactersRemaining--)\r
{\r
- /* Load in the next unicode character (only the lower byte, only Unicode coded ASCII supported) */\r
+ /* Load in the next unicode character (only the lower byte, as only Unicode coded ASCII is supported) */\r
*(Buffer++) = *UnicodeString;\r
\r
/* Jump to the next unicode character */\r