Sets the Peripheral Control State for UTS INT-1 sessions. This advanced feature is for applications that want control over print activity.

Namespace: ScreenUPG
Assembly: ScreenUPG (in ScreenUPG.dll)


Visual Basic (Declaration)
Public Sub setPeripheralControl( _ 
   ByVal pc As Boolean _ 
public void setPeripheralControl(
   bool pc
 void setPeripheralControl(
   bool pc
) sealed 
public void setPeripheralControl(
   bool pc
public  function setPeripheralControl(
   pc : bool


true to enable, false to disable, application control of peripheral responses.


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:

UTS_DEVICESTATUS_THRUfor an Acknowledgement/Thru
UTS_DEVICESTATUS_NOTREADYfor a slightly different Error
UTS_DEVICESTATUS_OFFLINEfor another slightly different error
UTS_DEVICESTATUS_POCfor 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.

See Also