Fixed PrinterHost demo Printer_GetDeviceID() routine not removing the Device ID strin...
[pub/USBasp.git] / Demos / Host / Incomplete / PrinterHost / Lib / PrinterCommands.h
index e9c1d9f..4656d19 100644 (file)
 \r
        /* Includes: */\r
                #include <avr/io.h>\r
+               #include <string.h>\r
 \r
                #include <LUFA/Drivers/USB/USB.h>\r
 \r
        /* Macros: */\r
-               #define PROTOCOL_UNIDIRECTIONAL      0x01\r
-               #define PROTOCOL_BIDIRECTIONAL       0x02\r
-               #define PROTOCOL_IEEE1284            0x03\r
-               \r
+               /** Printer class-specific request to retrieve the printer's ID string */\r
                #define GET_DEVICE_ID                0\r
+\r
+               /** Printer class-specific request to retrieve the printer's virtual port status flags */\r
                #define GET_PORT_STATUS              1\r
+\r
+               /** Printer class-specific request to soft-reset the device */\r
                #define SOFT_RESET                   2\r
 \r
+               /** Pipe number of the Printer data IN pipe */\r
+               #define PRINTER_DATA_IN_PIPE         1\r
+\r
+               /** Pipe number of the Printer data OUT pipe */\r
+               #define PRINTER_DATA_OUT_PIPE        2\r
+               \r
        /* Type Defines: */\r
                typedef struct\r
                {\r
+                       char*    Data;\r
                        uint16_t Length;\r
-                       uint8_t  String[128];\r
-               } Device_ID_String_t;\r
+               } Printer_Data_t;\r
                \r
        /* Function Prototypes: */\r
-               uint8_t Printer_GetDeviceID(Device_ID_String_t* DeviceIDString);\r
+               uint8_t Printer_SendData(Printer_Data_t* PrinterCommands);\r
+               uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize);\r
                uint8_t Printer_GetPortStatus(uint8_t* PortStatus);\r
                uint8_t Printer_SoftReset(void);\r
        \r