USING RPUPortSet The standard serial and parallel port drivers do not support the SplPdSet API. The PAR1284 port driver takes a data structure with the following format: ULONG signature; /* Must be 0x52464E49 ('INFR') */ ULONG ulVersion; /* Must be 0x00000001 */ ULONG flStatus; /* Status flags: */ /* 0x00000001 BIDI_Q_PORT set (bidi enabled)*/ /* 0x00000002 Set after 1st attempt at bidi */ /* 0x00000004 Port connected to print queue */ /* 0x00000008 Port already open */ /* 0x00000010 Port open in progress */ /* 0x00000020 SplPdOpen being processed */ /* 0x00000040 SplPdClose being processed */ /* 0x00000080 XlateCmd has more alerts left */ /* 0x00000100 New printer or powered off */ /* 0x00000200 Set when deviceId was checked */ /* after first good write to a */ /* unidirectional printer. */ /* 0x00000400 Set when last write was sent */ /* using ECP mode cmd channel. */ /* 0x00000800 Set when printer put in bidi */ /* mode and DeviceID received. */ /* 0x00001000 Set when CommStatChange alert */ /* was posted to spooler. */ /* Cleared after BIDI_Q_PORT */ /* 0x00002000 Set when CommStatChange alert */ /* should not be set */ /* 0x00004000 Set when port has a network */ /* connection */ ULONG flBidiCapabilities; /* PRTPORT.flBidiCapabilities _CAPS_ */ ULONG flBidiProtocol; /* PRTPORT.flBidiProtocol _TYPE_ */ ULONG flJob; /* PRTSW.flJob flags */ ULONG flDevice; /* PRTSW.flDevice flags */ ULONG ulModeSelected; /* Mode selected by user(see PARMODE_) */ ULONG ulCurrentMode; /* Current mode of port(see CURMODE_) */ BOOL fShareAccess; /* Share port with DOS/Windows */ ULONG ulPrintTimeOut; /* Seconds to continue to retry job */ /* write request in SplPdWrite(). */ /* Default: 45 seconds */ ULONG ulNoQueryTimeOut; /* Seconds from last query until */ /* port drops printer connection */ /* Default: 180 seconds */ ULONG ulNoJobTimeOut; /* Seconds from last job sent until */ /* port drops printer connection */ /* NOTE: Connection can be dropped */ /* sooner if PDR receives */ /* BIDI_NOTIFY_ENDJOBCONNECT */ /* This is used if we lose */ /* a job acknowledgement so */ /* that other Apps can use the */ /* infrared port. */ /* Default: 300 seconds */ /* */ PPTIMEOUTCHANNEL TimeOut; /* Read and Write timeouts */ /* */ /* */ /* The following ulpsz fields are */ /* offsets from the beginning of */ /* this PORTSETTINGS structure to */ /* the variable length strings. */ /* This allows us to pass the buffer */ /* intact to PrtQuery and PrtSet, */ /* even across the network. */ /* All strings are packed immediately */ /* after the fixed-length PORTSETTINGS */ /* structure. */ /* */ /* An offset of 0 means no string */ /* */ ULONG ulpszPortName; /* -> name of port info is for */ ULONG ulpszDeviceID; /* -> 1284 deviceID for printer on port */ } PORTSETTINGS, *PPORTSETTINGS; #define PAR12_SIGNATURE typedef struct _PPTIMEOUTCHANNEL{ ULONG ulReadIdleTimeOut; // millisecs DD has to complete entire Read ULONG ulReadIntTimeOut; // millisecs DD waits for Read interrupt ULONG ulWriteIdleTimeOut; // millisecs DD has to complete entire Write ULONG ulWriteIntTimeOut; // millisecs DD waits for Write interrupt ULONG ulLogChannel; // 1=use data channel, 2=use address channel } PPTIMEOUTCHANNEL, *PPPTIMEOUTCHANNEL; Port settings structure for CUPS.PDR: typedef struct _PORTSETTINGS { CHAR szHost[ 65 ]; // CUPS server hostname/IP CHAR szQueue[ 65 ]; // CUPS printer queue name } PORTSETTINGS, *PPORTSETTINGS; Port setting structure for SMB.PDR: /* szPortData contains all of the port parameters in a single buffer: */ /* host */ /* printer */ /* workgroup */ /* userid */ /* copies */ /* password */ /* All except 'password' are verbatim character strings; 'password' is */ /* a hexadecimal string. Fields are separated by '#'. All fields are */ /* required; those with unspecified values are left empty. */ typedef struct _PORTSETTINGS { CHAR szPortData[ 256 ]; } PORTSETTINGS, *PPORTSETTINGS;