
TPMC118-SW-95 – QNX6 Neutrino Device Driver
Page 9 of 30
3.3 devctl()
NAME
devctl() – device control functions
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
#include <devctl.h>
int devctl
(
int
filedes,
int
dcmd,
void
*data_ptr,
size_t
n_bytes,
int
*dev_info_ptr
)
DESCRIPTION
The devctl function sends a control code directly to a device, specified by
filedes
, causing the
corresponding device to perform the requested operation.
The argument
dcmd
specifies the control code for the operation.
The arguments
data_ptr
and
n_bytes
depends on the command and will be described for each
command in detail later in this chapter. Usually
data_ptr
points to a buffer that passes data between
the user task and the driver and
n_bytes
defines the size of this buffer.
The argument
dev_info_ptr
is unused for the TPMC118 driver and should be set to NULL.