aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-07-20 03:07:27 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-07-20 03:07:27 +0000
commit4c035b14f1349828384946523987f009c9966690 (patch)
treefbda7f2fa935af2bd51252875407da68bc429446 /Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
parent5d8cdd9bea07acd276b260b34bea299a45a9088a (diff)
downloadlufa-4c035b14f1349828384946523987f009c9966690.tar.gz
lufa-4c035b14f1349828384946523987f009c9966690.tar.bz2
lufa-4c035b14f1349828384946523987f009c9966690.zip
Cleaner solution to the PrinterHost data send routine problem of embedded NULLs - use a special structure to hold the data string plus the length in bytes of the data.
Diffstat (limited to 'Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h')
-rw-r--r--Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h b/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
index b296d86f6..9ba6d4d5d 100644
--- a/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
+++ b/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
@@ -53,8 +53,15 @@
/** Pipe number of the Printer data OUT pipe */
#define PRINTER_DATA_OUT_PIPE 2
+ /* Type Defines: */
+ typedef struct
+ {
+ char* Data;
+ uint16_t Length;
+ } Printer_Data_t;
+
/* Function Prototypes: */
- uint8_t Printer_SendData(char* PrinterCommands, uint16_t DataLength);
+ uint8_t Printer_SendData(Printer_Data_t* PrinterCommands);
uint8_t Printer_GetDeviceID(char* DeviceIDString, uint8_t BufferSize);
uint8_t Printer_GetPortStatus(uint8_t* PortStatus);
uint8_t Printer_SoftReset(void);