Verastream SDK .Net Reference
setPeripheralControl Method



true to enable, false to disable, application control of peripheral responses.
Sets the Peripheral Control State for UTS INT-1 sessions. This advanced feature is for applications that want control over print activity.
Syntax
'Declaration
 
Public Sub setPeripheralControl( _
   ByVal pc As Boolean _
) 
'Usage
 
Dim instance As ScreenUPG
Dim pc As Boolean
 
instance.setPeripheralControl(pc)
public void setPeripheralControl( 
   bool pc
)
public:
void setPeripheralControl( 
   bool pc
) 

Parameters

pc
true to enable, false to disable, application control of peripheral responses.
Remarks
The setPeripheralControl method is called for an application to either establish or relinquish control over peripheral status response generation (i.e. it is used to change modes). getPeripheralControl is used to check to see if the application has control over the peripheral generation mechanism or not (i.e. to determine which mode the SDK is in). By default, an application does NOT have control over peripheral responses (the SDK automatically handles answering/ACKing print operations). If the application desires to have control over peripheral responses (meaning that the SDK will not generate peripheral THRUs automatically), then pass "true" to enable. In the mode where the application has control, the application is responsible for generating peripheral responses by calling the SendStatus method after each host print operation.

The relevant arguments for the SendStatus method are:

UTS_DEVICESTATUS for the first parameter (type) when dealing with UTS/INT-1 statuses.

The second parameter should be a 1 byte value of one of the following:

Value Description
UTS_DEVICESTATUS_THRU for an Acknowledgement/Thru
UTS_DEVICESTATUS_ERROR for an Error/NACK
UTS_DEVICESTATUS_NOTREADY for a slightly different Error
UTS_DEVICESTATUS_OFFLINE for another slightly different error
UTS_DEVICESTATUS_POC for a Power-on Confidence (should only be used at startup)

If an application wants to control INT-1 peripheral responses it should call setPeripheralControl(true) at startup and then check that getPeripheralControl confirms that with a returned value of true. Then, after every text message is received for the printer, the application should call SendStatus with one of the possible arguments. The first two values (UTS_DEVICESTATTUS_THRU and UTS_DEVICESTATUS_ERROR) will likely be sufficient. Calling SendStatus when a print operation is not outstanding will result in no peripheral status being sent to the host.

As an aide to tell when the application should be sending a printer status, the getOIAContents method can be used. The UTS OIA data contains two pieces of data which the application may want to check. Byte 102 is the Printer DID. If peripheral control is enabled, then this byte 102 value will be the currently selected printer DID (normally 0x73) or 0 if no Printer DID is selected. A Byte 104 has been added to the UTS OIA data - which is a "Printer Status Response" indication. This is intended as a aide in determine when the host is performing a print operation. The "Printer Status Response" byte is 1 if a printer status response is outstanding (i.e. the application needs to call SendStatus to complete the host operation) and 0 otherwise. If peripheral control is set to false, then byte 104 will always be 0.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also