
PCI-1680U/1682U User Manual 30
Parameters
Return Value
Successful: return non-zero values. Unsuccessful: return zero value. Please call Get-
LastError function.
It will be considered unsuccessful if zero values are returned in the following situa-
tion. Please call GetLastError.
In work mode, drivers can not complete some of the requests, GetLastError will be
called to return ERROR_GEN_FAILURE.
Example
Set baud rate:
DWORD dwReturned;
Command_par_t cmd;
Config_par_t config;
cmd.cmd = CMD_STOP;
BOOL bSuccess = DeviceIoControl (
hDevice,
CAN_IOCTL_COMMAND,
&cmd,
sizeof(Command_par),
NULL,
0,
&dwReturned,
NULL
);
if(!bSuccess)
{
//error
}
config.target = CONF_TIMING;
config.val1 = 1000; //set 1000K
Name Direction Description
hDevice Input Handle of the device which was opened.
dwIoControlCode Input Control code, shows the specific operation mode.
lpInBuffer Input Start address sent to data area of driver.
nInBufferSize Input Byte length sent to data area of driver.
lpOutBuffer Output Address of data area which receives driver's return data.
nOutBufferSize Input Byte length of data area which receives driver's return data.
lpBytesReturned Output Real byte length of data received from driver.
lpOverlapped Input
If CreateFile uses asynchronous open, asynchronous oper-
ation must be supported here. Please refer to MSDN for
detailed instruction to asynchronous open.
*Note In WINDOWS CE,set to NULL.
Comentarios a estos manuales