Lucent Technologies USS-720 manual DeviceIoControl

Page 65

Preliminary User Guide, Rev. 2

USS-720

February 1999

USB Device Driver

 

 

3 I/O File Functions (continued)

3.4 DeviceIoControl

The DeviceIoControl I/O file function sends a control code to a device instance and returns TRUE if the function is successful and FALSE if it fails. Details regarding the syntax, parameters, return values, and error codes are listed below.

3.4.1 Syntax

 

BOOL

 

DeviceIoControl(

 

HANDLE

hDev,

DWORD

dwIoControlCode,

LPVOID

lpInBuffer,

DWORD

nInBufferSize,

LPVOID

lpOutBuffer,

DWORD

nOutBufferSize,

LPDWORD

lpBytesReturned,

LPOVERLAPPED

lpOverlapped

);

 

3.4.2 Parameters

Input:

hDev—Handle returned from a successful CreateFile.

dwIoControlCode—Specifies the control code for the operation. See Section 4 of this document for a list of valid I/O control codes and more detailed information on each control code.

lpInBuffer—Pointer to a buffer that contains the data required to perform the operation. This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not require input data. The usage of lpIn- Buffer is dependent on the dwIoControlCode parameter.

nInBufferSize—Specifies the size (in bytes) of the buffer pointed to by lpInBuffer. The usage of nInBufferSize is dependent on dwIoControlCode parameter.

lpOverlapped—Pointer to OVERLAPPED structure. This is an optional parameter that can be “NULL” if overlapping I/O is not required.

Output:

lpOutBufferSize—Pointer to a buffer that receives the operation’s output data. This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not require output data. The usage of lpOutBufferSize is dependent on dwIoControlCode parameter.

nOutBufferSize—Specifies the size (in bytes) of the buffer pointed to by lpOutBuffer. The usage of nOutBufferSize is dependent on dwIoControlCode parameter.

lpBytesReturned—Pointer to a variable that receives the size (in bytes) of data stored into the output buffer pointed to by lpOutBuffer. The usage of lpBytesReturned is dependent on dwIoControlCode parameter.

3.4.3 Return Values

If the function succeeds, the return value is TRUE (1).

If the function fails, the return value is FALSE (0). To get extended error information, call GetLastError.

3.4.4 Notes

See the Win32 SDK documentation for complete definitions.

Lucent Technologies Inc.

7-7

Image 65
Contents Information Manual, Rev September IntroductionTable of Contents September USB-to-IEEE Bridge Information Manual, Rev Evaluation Kit for USS-720IOCTLSET1284REGISTER USS-720 USB Device Driver Preliminary User GuideIOCTL1284 Terminate USS-720 USB Port Monitor Application Note Evaluation Kit Contents \SAMPLES Hardware RequirementsGetting Started Instructions OSR2.1 Cable Installation InstructionsWindows 98 Cable Installation Instructions Software UpdatesPort Creation USB Driver and Port MonitorPlug and Play Eeprom Lucent Technologies Inc In-System Design, Inc Lucent Technologies Microelectronics GroupUSB Applications Support September USS-720 Driver Software Object Code License Agreement Evaluation Kit SoftwareFebruary IntroductionLicensed Software USS-720 Software Use Agreement FebruaryFurnishing of Licensed Software OwnershipFebruary Software Use Agreement USS-720Agreement Prevails Warranty and IndemnityNothing Construed 04 ConfidentialityNonassignability PublicityAddresses IntegrationDisputes Applicable LawDocumentation USS720.SYSUSS720.INF USS-720 Software Use Agreement February Application Note, Rev February Software ComponentsPrinter Enumeration Customer-Defined DataPlug and Play Operation PnP Installation Process Power ManagementOperating Systems Supported USB Hardware Types SupportedPrint Types Supported Printer Types SupportedDescription FeaturesPreliminary Data Sheet, Rev September Table of Contents USB-to-IEEE Preliminary Data Sheet, Rev USS-720Pin Information Parallel Port nSelectIn Signal Active-Low Parallel Port nAutoFd Signal Active-LowParallel Port nInit Signal Active-Low Parallel Port nAck Signal Active-LowUSB Port OverviewDevice Descriptor, Configurations, and Inter- faces Descriptor LocationsDevice Descriptor Offset Field Size Value Description USB-to- Ieee 1284 Bridge SeptemberOnboard Device Descriptor Configuration Descriptor USB-to- IeeeBulk Out Endpoint Descriptor, I0A0E1 Interface DescriptorsBulk In Endpoint Descriptor, I0A1E2 September USB-to-IEEE1284 BridgeBulk Out Endpoint Descriptor, I0A1E1 Interrupt Endpoint Descriptor, I0A2E3 Bulk Out Endpoint Descriptor, I0A2E1Bulk In Endpoint Descriptor, I0A2E2 Standard Requests PipesRequests Get Port Status Data Bit Description Printer Class-Specific RequestsSET1284REGISTER Vendor-Specific RequestsGET1284REGISTER Register-Based Operation Ieee 1284 PortGET1284REGISTER Data Byte Register Data RegistersInterrupt Pipe Read Data Byte Register DataParallel Port nFault Signal Reserved Status Register Address Bit SymbolDefault Bit Symbol Bit Description Access Default Bit Symbol Bit Description Control Register Address Bit SymbolParallel Port nInit Signal USB-to-IEEE1284 BridgeUSS-720Instant USB ECP Command Register Address Bit Symbol Access Mode20 Description Extended Control Register Address Bit SymbolUSS-720 Control Register Address Bit Symbol USS-720 Setup Register Address Bit Symbol Interrupts External Crystal Connection External Circuitry RequirementsHigh Drive Mode Filter Bypass ModeSelf-Powered Mode Absolute Maximum Ratings Parameter Symbol Min UnitParameter Symbol Test Conditions Min Typ Max Unit Electrical CharacteristicsCapacitance Values Parameter Unit Clklo ClkhiOutput Delay Timing Parameter Min Max Unit Timing CharacteristicsSetup and Hold Input Timing Parameter Ordering Information Outline DiagramPin Mqfp Device Code Package ComcodeApplication Note February Description Port ParallelBridging USB to Typical Circuit Showing USSLucent Technologies Inc Preliminary User Guide, Rev February Signal DirectionsIOCTL1284 Setmode O File Functions InitializationPreliminary User Guide, Rev USS-720 February USB Device DriverCreateFile ReadFile Error CodesWriteFile DeviceIoControl CloseHandle Control Code Description O Control CodesParameters IOCTL1284 EcpfwdtorevIOCTL1284ECPREVTOFWD IOCTL1284 Ecpsetchannel IOCTL1284 Setmode Register Mode DescriptionIOCTL1284 Terminate Value Description IoctlabortpipeBulkoutpipe BulkinpipeIoctlcancelpiperequest IOCTLGET1284REGISTER ALTINTERFACE0 IoctlgetaltsettingALTINTERFACE1 ALTINTERFACE2Ioctlgetcapabilities Ioctlgetconfigurationdescriptor Ioctlgetdevicedescriptor Ioctlgetdeviceinstances Ioctlgetinterface Bit Meaning IoctlgetportstatusCommand Description IOCTLISSUEUSS720COMMANDByte Description IoctlreadinterruptpipeIoctlresetpipe IOCTLSET1284REGISTER Ioctlsetaltsetting Ioctlsoftreset Deviceinstanceheader O Control Data StructuresDeviceinstance Data StructureREGISTER1284, *PREGISTER1284 REGISTER1284ADVREGISTER1284, *PADVREGISTER1284 ADVREGISTER1284Lucent Technologies Inc USS-720 USB Port Monitor Printer Cable with Instant USB USS-720 Application Note USB Port Monitor FebruaryW98USS720EvalKit2402.zip to download the installation files Software Installation InstructionsApplication Note June Click on Enter LibrarySeptember MN99-052CMPR-1 Replaces MN97-061CMPR-04