EasyManua.ls Logo

ABLE Ap1400 - Page 39

ABLE Ap1400
42 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Ref: "Ap1400ProgGuide1_2.docx" Page 39 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
SendCtrl
Send a control request or control data to a device
Prototype
int WINAPI SendCtrl(int iHandle,
int iReqType,
int iRequest,
int iValue,
int iIndex,
LPINT pBufSize,
LPCTSTR pData);
Description.
Sends a control request or control data to the specified device and reads any return
values or data. The request is made over the control endpoint. This endpoint is bi-
directional and synchronous so when a data return is expected the function will
block until the return data is received or a timeout occurs. The timeout value is
controlled by the USB and cannot be set by the user.
Care must be taken when constructing the call as invalid data could cause the
device to react unpredictably or to close the endpoint pipe.
Control requests are high priority and actioned immediately by the device (or as
close to immediate as the device can manage), thus uncontrolled control requests
could cause undesired effects to the base functionality of the device. (IE jerky or
uneven printing). A full list of control requests is available on request.
Arguments
ihandle – Handle of an open device. This handle must have been issued by a
previous call to OpenDevice.
iReqtype-The request type. For the Ap1400 this value will always be
USB_TYPE_CLASS|USB_RECIP_DEVICE|USB_ENDPOINT_IN.
iRequest-The high level command request. Supported user requests are
USB_GS_COMMAND and USB_BUFFERSTATE
iValue - The sub-command. This value identifies the actual command from within
the high level command group. Current supported values are
USB_GS_I_TYPE, USB_GS_ENQ_TYPE and USB_CAN_TYPE. The low
order 8 bits of this field contain the type request. For a
list of these values please refer to the serial
documentation for the GS ‘I’ command.
iIndex- Data block index. This is used to reference a valid data
block within the USB control structures. This value is not
supported for user based requests and must be 0.
pBufSize-
Pointer to an integer field whch initially contains the
length of the supplied buffer for data return. On return
from the function, this value will contain the length of
any data returned.
pData – Pointer to a buffer to receive any returned data. This
buffer must be large enough to receive all returned data up
to a maximum of 64 bytes, and at least as large as the
value specified in pBufSize.
Returns
ERROR_SUCCESS if successful, otherwise the value is set to the system error
code.

Related product manuals